Skip to content

Commit 7e04c04

Browse files
authored
Merge pull request #31 from arran4/patch-1
Null and undef checking on object keys otherwise fails to handle 0.
2 parents cd5021f + 26eaf0a commit 7e04c04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ function ToObject(o: any, typeOrCfg: any = {}, child = false): any {
4343

4444
for (const k of Object.keys(o)) {
4545
const v: any = o[k];
46-
if (!v) continue;
46+
if (v === undefined) continue;
47+
if (v === null) continue;
4748
d[k] = ToObject(v, typeOrCfg[k] || {}, true);
4849
}
4950

0 commit comments

Comments
 (0)