github
3964 of 4157 branches covered (95.36%)
454 of 493 new or added lines in 29 files covered. (92.09%)
26538 of 32109 relevant lines covered (82.65%)
1222.68 hits per line
1 |
import { DateFieldCore } from '@teable/core'; |
4✔ |
|
import type { FieldBase } from '../field-base'; |
4✔ |
|
|
4✔ |
|
export class DateFieldDto extends DateFieldCore implements FieldBase { |
4✔ |
|
get isStructuredCellValue() { |
4✔ |
NEW
|
return false; |
× |
NEW
|
} |
× |
8 |
|
4✔ |
9 |
convertCellValue2DBValue(value: unknown): unknown { |
|
10 |
if (this.isMultipleCellValue) { |
|
11 |
return value == null ? value : JSON.stringify(value);
|
|
12 |
} |
|
13 |
return value;
|
289✔ |
14 |
} |
289✔ |
15 |
|
4✔ |
16 |
convertDBValue2CellValue(value: unknown): unknown { |
|
17 |
if (this.isMultipleCellValue) { |
|
18 |
return value == null || typeof value === 'object' ? value : JSON.parse(value as string); |
|
19 |
} |
|
20 |
if (value instanceof Date) {
|
|
21 |
return value.toISOString();
|
3,957✔ |
22 |
} |
|
23 |
return value;
|
1,162✔ |
24 |
} |
1,162✔ |
25 |
} |
4✔ |