Skip to content

Commit cadf4b6

Browse files
palbizuPatricio Albizu
andauthored
feat: table cell no-op parser update (#876)
* feat: table cell no-op parser update * feat: remove unused expressions * feat: adding comment to omit line * feat: adding comment to omit line Co-authored-by: Patricio Albizu <albizupatricio@github.com>
1 parent f45651b commit cadf4b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

projects/components/src/table/cells/data-parsers/table-cell-no-op-parser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { Dictionary } from '@hypertrace/common';
21
import { TableCellParser } from '../table-cell-parser';
32
import { TableCellParserBase } from '../table-cell-parser-base';
43
import { CoreTableCellParserType } from '../types/core-table-cell-parser-type';
54

65
@TableCellParser({
76
type: CoreTableCellParserType.NoOp
87
})
9-
export class TableCellNoOpParser extends TableCellParserBase<unknown, unknown, string | undefined> {
10-
public parseValue(cellData: unknown): unknown {
8+
export class TableCellNoOpParser<T = unknown> extends TableCellParserBase<T, T, string | undefined> {
9+
public parseValue(cellData: T): T {
1110
return cellData;
1211
}
1312

14-
public parseFilterValue(cellData: unknown): string | undefined {
13+
public parseFilterValue(cellData: T | { filterValue?: string }): string | undefined {
14+
// tslint:disable-next-line:strict-type-predicates
1515
if (typeof cellData === 'object' && cellData !== null && 'filterValue' in cellData) {
16-
return (cellData as Dictionary<unknown>).filterValue as string;
16+
return cellData.filterValue;
1717
}
1818

1919
return String(cellData);

0 commit comments

Comments
 (0)