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

safe-json-value

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

safe-json-value - npm Package Compare versions

Comparing version 1.10.0 to 1.11.0

build/src/main.d.ts

8

build/src/array.js

@@ -19,4 +19,4 @@ import{transformProp}from"./prop.js";

maxSize,
recurse})
{
recurse
}){
const newArray=[];

@@ -37,5 +37,5 @@

size:state.size,
recurse});
recurse
});
if(state.value!==undefined){

@@ -42,0 +42,0 @@ newArray.push(state.value);

@@ -14,4 +14,4 @@ import{recurseArray}from"./array.js";

maxSize,
recurse})
{
recurse
}){
if(!isObject(value)){

@@ -26,4 +26,4 @@ return{value,size:newSize};

newValue:undefined,
reason:"unsafeCycle"});
reason:"unsafeCycle"
});
return{value:undefined,size};

@@ -40,4 +40,4 @@ }

maxSize,
recurse});
recurse
});
ancestors.delete(value);

@@ -54,4 +54,4 @@ return{value:valueA,size:newSizeA};

maxSize,
recurse})
{
recurse
}){
return Array.isArray(value)?

@@ -65,4 +65,4 @@ recurseArray({

maxSize,
recurse}):
recurse
}):
recurseObject({

@@ -75,5 +75,5 @@ object:value,

maxSize,
recurse});
recurse
});
};
//# sourceMappingURL=cycle.js.map

@@ -24,4 +24,4 @@ import normalizeException from"normalize-exception";

reason:"unsafeGetter",
error:normalizeException(error)});
error:normalizeException(error)
});
return{prop:undefined,safe:false};

@@ -46,4 +46,4 @@ }

prop,
descriptor:{get,set}})
{
descriptor:{get,set}
}){
if(get!==undefined||set!==undefined){

@@ -54,4 +54,4 @@ changes.push({

newValue:prop,
reason:"unresolvedGetter"});
reason:"unresolvedGetter"
});
}

@@ -65,4 +65,4 @@ };

prop,
descriptor:{writable,configurable}})
{
descriptor:{writable,configurable}
}){
if(writable===false){

@@ -73,4 +73,4 @@ changes.push({

newValue:prop,
reason:"descriptorNotWritable"});
reason:"descriptorNotWritable"
});
}

@@ -83,6 +83,6 @@

newValue:prop,
reason:"descriptorNotConfigurable"});
reason:"descriptorNotConfigurable"
});
}
};
//# sourceMappingURL=get.js.map

@@ -21,4 +21,4 @@ import{safeGetChangeProp}from"./get.js";

newValue:undefined,
reason:"ignoredArrayProperty"});
reason:"ignoredArrayProperty"
});
}

@@ -25,0 +25,0 @@ }

@@ -10,4 +10,4 @@

newValue:undefined,
reason:"ignoredSymbolKey"});
reason:"ignoredSymbolKey"
});
return{prop:undefined,validKey:false};

@@ -21,4 +21,4 @@ }

newValue:undefined,
reason:"ignoredNotEnumerable"});
reason:"ignoredNotEnumerable"
});
return{prop:undefined,validKey:false};

@@ -25,0 +25,0 @@ }

@@ -27,4 +27,4 @@ import{checkCycleThenRecurse}from"./cycle.js";

maxSize,
shallow});
shallow
});
return{value:newValue,changes};

@@ -43,4 +43,4 @@ }

maxSize,
shallow})
{
shallow
}){
try{

@@ -57,4 +57,4 @@ const valueA=callToJSON(value,changes,path);

maxSize,
shallow});
shallow
});
}catch(error){

@@ -83,4 +83,4 @@ return handleUnsafeException({value,changes,path,error,size});

maxSize,
shallow})
{
shallow
}){
const{size:newSize,stop}=addSize({

@@ -92,5 +92,5 @@ type:"value",

path,
context:value});
context:value
});
if(stop){

@@ -109,4 +109,4 @@ return{value:undefined,size};

maxSize,
recurse});
recurse
});
};

@@ -113,0 +113,0 @@

@@ -20,4 +20,4 @@ import isPlainObj from"is-plain-obj";

maxSize,
recurse})
{
recurse
}){
const newObject=getNewObject(object);

@@ -37,5 +37,5 @@ let state={empty:true,size};

size:state.size,
recurse});
recurse
});
if(state.value!==undefined){

@@ -67,6 +67,6 @@ newObject[key]=state.value;

newValue:newObject,
reason:"unresolvedClass"});
reason:"unresolvedClass"
});
}
};
//# sourceMappingURL=object.js.map

@@ -16,4 +16,4 @@ import{safeGetProp}from"./get.js";

size,
recurse})
{
recurse
}){
const propPath=[...path,key];

@@ -26,5 +26,5 @@ const{size:sizeA,stop}=addSize({

path:propPath,
context:{empty,parent,key}});
context:{empty,parent,key}
});
if(stop){

@@ -42,4 +42,4 @@ return{empty,size};

maxSize,
recurse});
recurse
});
return value===undefined?

@@ -59,4 +59,4 @@ {empty,size}:

maxSize,
recurse})
{
recurse
}){
const{prop,safe}=safeGetProp({parent,key,changes,path});

@@ -73,5 +73,5 @@

changes,
path});
path
});
if(!validKey){

@@ -78,0 +78,0 @@ return{value:propA,size};

@@ -32,4 +32,4 @@ import{safeGetChangeProp}from"./get.js";

path,
context})
{
context
}){
if(maxSize===SKIP_MAX_SIZE){

@@ -51,4 +51,4 @@ return{size,stop:false};

newValue:undefined,
reason:"unsafeSize"});
reason:"unsafeSize"
});
return{size,stop};

@@ -78,4 +78,4 @@ };

return value;
}},
}
},
arrayItem:{

@@ -85,4 +85,4 @@ getSize({empty}){

},
getOldValue:safeGetChangeProp},
getOldValue:safeGetChangeProp
},
objectProp:{

@@ -92,3 +92,5 @@ getSize({key,empty}){

},
getOldValue:safeGetChangeProp}};
getOldValue:safeGetChangeProp
}
};

@@ -103,4 +105,2 @@

const getJsonLength=function(value){

@@ -107,0 +107,0 @@ try{

@@ -25,4 +25,4 @@ import normalizeException from"normalize-exception";

newValue:toJSONResult,
reason:"unresolvedToJSON"});
reason:"unresolvedToJSON"
});
return toJSONResult;

@@ -35,4 +35,4 @@ }catch(error){

reason:"unsafeToJSON",
error:normalizeException(error)});
error:normalizeException(error)
});
}

@@ -39,0 +39,0 @@ };

@@ -32,3 +32,4 @@

undefined:"ignoredUndefined",
bigint:"unsafeBigInt"};
bigint:"unsafeBigInt"
};
//# sourceMappingURL=type.js.map

@@ -21,4 +21,4 @@ import normalizeException from"normalize-exception";

error,
size})
{
size
}){
changes.push({

@@ -29,6 +29,6 @@ path,

reason:"unsafeException",
error:normalizeException(error)});
error:normalizeException(error)
});
return{value:undefined,size};
};
//# sourceMappingURL=uncaught.js.map
{
"name": "safe-json-value",
"version": "1.10.0",
"version": "1.11.0",
"type": "module",
"exports": {
"types": "./build/types/main.d.ts",
"types": "./build/src/main.d.ts",
"default": "./build/src/main.js"
},
"main": "./build/src/main.js",
"types": "./build/types/main.d.ts",
"types": "./build/src/main.d.ts",
"files": [
"build/src/**/*.{js,json}",
"build/types/**/*.d.ts"
"build/src/**/*.{js,json,d.ts}",
"!build/src/**/*.test.js",
"!build/src/{helpers,fixtures}"
],

@@ -58,4 +59,4 @@ "sideEffects": false,

"devDependencies": {
"@ehmicky/dev-tasks": "^1.0.102",
"test-each": "^5.5.0"
"@ehmicky/dev-tasks": "^2.0.52",
"test-each": "^5.6.0"
},

@@ -62,0 +63,0 @@ "engines": {

@@ -8,6 +8,6 @@ <picture>

[![Browsers](https://img.shields.io/badge/-Browsers-808080?logo=firefox&colorA=404040)](https://unpkg.com/safe-json-value?module)
[![TypeScript](https://img.shields.io/badge/-Typed-808080?logo=typescript&colorA=404040&logoColor=0096ff)](/types/main.d.ts)
[![TypeScript](https://img.shields.io/badge/-Typed-808080?logo=typescript&colorA=404040&logoColor=0096ff)](/src/main.d.ts)
[![Codecov](https://img.shields.io/badge/-Tested%20100%25-808080?logo=codecov&colorA=404040)](https://codecov.io/gh/ehmicky/safe-json-value)
[![Minified size](https://img.shields.io/bundlephobia/minzip/safe-json-value?label&colorA=404040&colorB=808080&logo=webpack)](https://bundlephobia.com/package/safe-json-value)
[![Twitter](https://img.shields.io/badge/-Twitter-808080.svg?logo=twitter&colorA=404040)](https://twitter.com/intent/follow?screen_name=ehmicky)
[![Mastodon](https://img.shields.io/badge/-Mastodon-808080.svg?logo=mastodon&colorA=404040&logoColor=9590F9)](https://fosstodon.org/@ehmicky)
[![Medium](https://img.shields.io/badge/-Medium-808080.svg?logo=medium&colorA=404040)](https://medium.com/@ehmicky)

@@ -58,3 +58,3 @@

This package works in both Node.js >=14.18.0 and
[browsers](https://raw.githubusercontent.com/ehmicky/dev-tasks/main/src/tasks/build/browserslist).
[browsers](https://raw.githubusercontent.com/ehmicky/dev-tasks/main/src/browserslist).
It is an ES module and must be loaded using

@@ -513,3 +513,3 @@ [an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c),

<tr>
<td align="center"><a href="https://twitter.com/ehmicky"><img src="https://avatars2.githubusercontent.com/u/8136211?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ehmicky</b></sub></a><br /><a href="https://github.com/ehmicky/safe-json-value/commits?author=ehmicky" title="Code">💻</a> <a href="#design-ehmicky" title="Design">🎨</a> <a href="#ideas-ehmicky" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ehmicky/safe-json-value/commits?author=ehmicky" title="Documentation">📖</a></td>
<td align="center"><a href="https://fosstodon.org/@ehmicky"><img src="https://avatars2.githubusercontent.com/u/8136211?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ehmicky</b></sub></a><br /><a href="https://github.com/ehmicky/safe-json-value/commits?author=ehmicky" title="Code">💻</a> <a href="#design-ehmicky" title="Design">🎨</a> <a href="#ideas-ehmicky" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ehmicky/safe-json-value/commits?author=ehmicky" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/papb"><img src="https://avatars.githubusercontent.com/u/20914054?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pedro Augusto de Paula Barbosa</b></sub></a><br /><a href="https://github.com/ehmicky/safe-json-value/commits?author=papb" title="Documentation">📖</a></td>

@@ -516,0 +516,0 @@ </tr>

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