Comparing version 2.0.0 to 2.0.1
@@ -30,2 +30,6 @@ 'use strict' | ||
function strict (str) { | ||
if (isObject(str)) { | ||
return true; | ||
} | ||
try { | ||
@@ -32,0 +36,0 @@ return JSON.parse(str) && true; |
{ | ||
"name": "is-json", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "check if a string is a valid JSON string without using Try/Catch", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,3 +27,8 @@ var test = require('tape'); | ||
assert.deepEqual(isJSON.strict('{\n "config": 123,\n "test": "abcde" \n}'), true, '`{\n "config": 123,\n "test": "abcde" \n}`, should return true'); | ||
assert.deepEqual( | ||
isJSON.strict({a: 1}), | ||
true, | ||
'should return true when passing a js object into `strict`' | ||
); | ||
assert.end(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5819
65