fix(Google Cloud Firestore Node): Fix empty string interpreted as number (#7136)

This commit is contained in:
Quang-Linh LE 2023-09-12 11:03:33 +02:00 committed by GitHub
parent b67a6fc432
commit 915cfa0f6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,7 @@ export function jsonToDocument(value: string | number | IDataObject | IDataObjec
return { booleanValue: value };
} else if (value === null) {
return { nullValue: null };
} else if (!isNaN(value as number)) {
} else if (value !== '' && !isNaN(value as number)) {
if (value.toString().indexOf('.') !== -1) {
return { doubleValue: value };
} else {