json-alexander
Advanced tools
Comparing version 0.1.10 to 0.1.11
{ | ||
"name": "json-alexander", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"description": "Serenity Now! Forgiving JSON parser", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -0,1 +1,2 @@ | ||
const { is } = require('uvu/assert') | ||
const { isBalanced, trimQuotes, isNull } = require('./utils') | ||
@@ -19,3 +20,3 @@ | ||
module.exports.safeParse = function simpleParse(data, defaultValue) { | ||
function simpleParse(data, defaultValue) { | ||
try { | ||
@@ -34,2 +35,4 @@ if (isNull(data) && defaultValue) { | ||
module.exports.safeParse = simpleParse | ||
function replaceInnerCharPattern(char = '\\s', open, close, repeat = 0, flags) { | ||
@@ -51,2 +54,9 @@ // og /\s(?=(?:(?:[^"]*(?:")){2})*[^"]*(?:")[^"]*$)/g | ||
if (typeof input === 'string') { | ||
const simple = simpleParse(input) | ||
if (simple) { | ||
return simple | ||
} | ||
} | ||
const value = (typeof input === 'string') ? coerceStr(input, defaultValue) : coerceToString(input) | ||
@@ -53,0 +63,0 @@ |
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
17503
459