isjsonobj
v1.0.0
Published
JSON Object validator
Downloads
1
Readme
isJSONObj
This module provides a function for JSON object validation
Install
npm i isjsonobj
How to use
const isJSONObj = require('isjsonobj');
console.log(isJSONObj("1")); // false
console.log(isJSONObj(1)); // false
console.log(isJSONObj(null)); // true
console.log(isJSONObj(undefined)); // false
console.log(isJSONObj(void(0))); // false
console.log(isJSONObj({})); // true
console.log(isJSONObj("{}")); // false
console.log(isJSONObj([])); // true
console.log(isJSONObj({a: 1})); // true
console.log(isJSONObj({"a": 1})); // true
console.log(isJSONObj([{"b": 1, c: null}])); // true
console.log(isJSONObj([{"b": 1, c: undefined }])); // false
console.log(isJSONObj([{"b": 1, c: void(0) }])); // false
console.log(isJSONObj([{"b": 1, c: function() {} }])); // false