Socket
Socket
Sign inDemoInstall

is-json

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-json - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

1

index.js

@@ -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, ']')

2

package.json
{
"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,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc