try-json-parse
Advanced tools
Comparing version 0.0.1 to 0.1.0
"use strict"; | ||
function tryToParseJson(string) { | ||
function tryToParseJson(string, reviver) { | ||
var result; | ||
try { | ||
result = JSON.parse(string); | ||
result = JSON.parse(string, reviver); | ||
} catch (error) { | ||
// oh error? well just return null, no biggie | ||
result = null; | ||
result = undefined; | ||
} | ||
@@ -12,0 +12,0 @@ |
{ | ||
"name": "try-json-parse", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Doesn't throw an error when JSON.parse() fails, just returns null", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ ### try-json-parse |
@@ -0,0 +0,0 @@ var JSONparse = require('./index'), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
3251
7