Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-alexander

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-alexander - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

2

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc