Comparing version 1.1.2 to 1.1.3
@@ -22,3 +22,2 @@ | ||
.test(str | ||
.replace(/""/, '"""') // deal with some bad structure ex: "a":"obja""b":[0], | ||
.replace(/\\["\\\/bfnrtu]/g, '@') | ||
@@ -25,0 +24,0 @@ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') |
{ | ||
"name": "is-json", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "check if a string is a valid JSON string without using Try/Catch", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,3 @@ var test = require('tape'); | ||
test('performe isJSON verifications', function (t) { | ||
t.plan(11); | ||
t.plan(10); | ||
@@ -16,4 +16,2 @@ t.deepEqual(isJSON(null), false, '`null`, should return false'); | ||
t.deepEqual(isJSON([1,2,3,4]), false, '`[1,2,3,4]`, should return false'); | ||
t.deepEqual(isJSON('{"a":"obja""b":[0,1,2],"c":{"d":"some object"}}'), false, | ||
'a bad JSON `\'{"a":"obja""b":[0,1,2],"c":{"d":"some object"}}\', should return false'); | ||
t.deepEqual(isJSON({a: 12, b: [1,2,3]}), false, 'a JSON object `{a: 12, b: [1,2,3]},`, should return false'); | ||
@@ -20,0 +18,0 @@ t.deepEqual(isJSON({a: 12, b: [1,2,3]}, true), true, |
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
4400
35