github
3878 of 4074 branches covered (95.19%)
402 of 435 new or added lines in 27 files covered. (92.41%)
26327 of 31880 relevant lines covered (82.58%)
1225.15 hits per line
1 |
import { FormulaFieldCore } from '@teable/core'; |
4✔ |
2 |
import type { IFieldBase } from '../field-base'; |
4✔ |
3 |
|
4✔ |
4 |
export class FormulaFieldDto extends FormulaFieldCore implements IFieldBase { |
4✔ |
|
get isStructuredCellValue() { |
4✔ |
NEW
|
return false; |
× |
NEW
|
} |
× |
|
|
4✔ |
9 |
convertCellValue2DBValue(value: unknown): unknown { |
|
10 |
if (this.isMultipleCellValue) { |
|
11 |
return value == null ? value : JSON.stringify(value);
|
|
12 |
} |
|
13 |
return value;
|
44,600✔ |
14 |
} |
44,600✔ |
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();
|
× |
22 |
} |
|
23 |
return value;
|
50,656✔ |
24 |
} |
50,656✔ |
25 |
} |
4✔ |