fix: allow null value for number and date (#1472)

This commit is contained in:
Jérémy M 2023-09-06 11:03:12 +02:00 committed by GitHub
parent f332c3bee2
commit cbcb49cd1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -100,7 +100,7 @@ export type FieldMetadata =
export type FieldTextValue = string;
export type FieldChipValue = string;
export type FieldDateValue = string;
export type FieldDateValue = string | null;
export type FieldPhoneValue = string;
export type FieldURLValue = string;
export type FieldNumberValue = number | null;

View File

@ -5,8 +5,7 @@ export function isFieldDateValue(
fieldValue: unknown,
): fieldValue is FieldDateValue {
return (
fieldValue !== null &&
fieldValue !== undefined &&
typeof fieldValue === 'string'
fieldValue === null ||
(fieldValue !== undefined && typeof fieldValue === 'string')
);
}

View File

@ -5,8 +5,7 @@ export function isFieldNumberValue(
fieldValue: unknown,
): fieldValue is FieldNumberValue {
return (
fieldValue !== null &&
fieldValue !== undefined &&
typeof fieldValue === 'number'
fieldValue === null ||
(fieldValue !== undefined && typeof fieldValue === 'number')
);
}