push
github
5667 of 5977 branches covered (94.81%)
140 of 144 new or added lines in 6 files covered. (97.22%)
37141 of 43682 relevant lines covered (85.03%)
1168.6 hits per line
|
import { isDate } from 'lodash'; |
4✔ |
|
|
4✔ |
|
export const convertValueToStringify = (value: unknown): number | string | null => { |
|
|
if (typeof value === 'bigint' || typeof value === 'number') { |
|
|
return Number(value);
|
588✔ |
|
} |
|
|
if (isDate(value)) {
|
|
NEW
|
return value.toISOString();
|
× |
NEW
|
} |
|
|
if (typeof value === 'string') { |
|
|
return value;
|
998✔ |
|
} |
|
|
if (value == null) return null; |
|
|
return JSON.stringify(value);
|
58✔ |
|
}; |
58✔ |