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 2.0.0 to 2.0.1

4

index.js

@@ -30,2 +30,6 @@ 'use strict'

function strict (str) {
if (isObject(str)) {
return true;
}
try {

@@ -32,0 +36,0 @@ return JSON.parse(str) && true;

2

package.json
{
"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();
});
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