mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 08:13:12 +09:00
Tests, 90% coverage
This commit is contained in:
1 parent
a7fcde60b8
commit
dbf209de61
3 files changed
+23
-1
No files matched your search
@@ -1,9 +1,11 @@
|
||||
module.exports = function(x){
|
||||
if(x === false || x === true || x === null) return true; // === false is valid JSON, so is true and null
|
||||
var isNotJson = false
|
||||
try{
|
||||
z = JSON.parse(x);
|
||||
} catch (e) {
|
||||
isNotJson = true;
|
||||
}
|
||||
|
||||
return !isNotJson;
|
||||
}
|
||||
Reference in new issue
Block a user