fix: #3207 ensure corner case

This commit is contained in:
Yidadaa
2023-11-10 15:15:43 +08:00
parent e6b72ac1ff
commit cb140e482f
2 changed files with 4 additions and 2 deletions

View File

@@ -6,5 +6,7 @@ export function ensure<T extends object>(
obj: T,
keys: Array<[keyof T][number]>,
) {
return keys.every((k) => obj[k] !== undefined && obj[k] !== null);
return keys.every(
(k) => obj[k] !== undefined && obj[k] !== null && obj[k] !== "",
);
}