NaN -> false (#1201)

This commit is contained in:
Orimay 2022-02-04 13:58:40 +03:00 committed by GitHub
parent 05f497778a
commit 666569f1d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
gun.js
View File

@ -142,7 +142,7 @@
// we want +/- Infinity to be, but JSON does not support it, sad face.
// can you guess what v === v checks for? ;)
("number" === typeof v && v != Infinity && v != -Infinity && v === v) ||
(v && "string" == typeof v["#"] && Object.keys(v).length === 1 && v["#"]);
(!!v && "string" == typeof v["#"] && Object.keys(v).length === 1 && v["#"]);
}
})(USE, './valid');