Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

devalue

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devalue - npm Package Compare versions

Comparing version
5.5.0
to
5.6.0
+1
-0
index.js
export { uneval } from './src/uneval.js';
export { parse, unflatten } from './src/parse.js';
export { stringify } from './src/stringify.js';
export { DevalueError } from './src/utils.js';
+1
-1
{
"name": "devalue",
"description": "Gets the job done when JSON.stringify can't",
"version": "5.5.0",
"version": "5.6.0",
"repository": "sveltejs/devalue",

@@ -6,0 +6,0 @@ "sideEffects": false,

@@ -67,3 +67,3 @@ import {

if (typeof thing === 'function') {
throw new DevalueError(`Cannot stringify a function`, keys);
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
}

@@ -204,3 +204,5 @@

`Cannot stringify arbitrary non-POJOs`,
keys
keys,
thing,
value
);

@@ -212,3 +214,5 @@ }

`Cannot stringify POJOs with symbolic keys`,
keys
keys,
thing,
value
);

@@ -215,0 +219,0 @@ }

@@ -50,3 +50,3 @@ import {

if (typeof thing === 'function') {
throw new DevalueError(`Cannot stringify a function`, keys);
throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
}

@@ -120,3 +120,5 @@

`Cannot stringify arbitrary non-POJOs`,
keys
keys,
thing,
value
);

@@ -128,3 +130,5 @@ }

`Cannot stringify POJOs with symbolic keys`,
keys
keys,
thing,
value
);

@@ -131,0 +135,0 @@ }

@@ -18,7 +18,11 @@ /** @type {Record<string, string>} */

* @param {string[]} keys
* @param {any} [value] - The value that failed to be serialized
* @param {any} [root] - The root value being serialized
*/
constructor(message, keys) {
constructor(message, keys, value, root) {
super(message);
this.name = 'DevalueError';
this.path = keys.join('');
this.value = value;
this.root = root;
}

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

@@ -12,2 +12,12 @@ declare module 'devalue' {

export function stringify(value: any, reducers?: Record<string, (value: any) => any>): string;
export class DevalueError extends Error {
/**
* @param value - The value that failed to be serialized
* @param root - The root value being serialized
*/
constructor(message: string, keys: string[], value?: any, root?: any);
path: string;
value: any;
root: any;
}
/**

@@ -14,0 +24,0 @@ * Revive a value serialized with `devalue.stringify`

@@ -7,2 +7,3 @@ {

"stringify",
"DevalueError",
"parse",

@@ -14,2 +15,3 @@ "unflatten"

"../src/stringify.js",
"../src/utils.js",
"../src/parse.js"

@@ -20,6 +22,7 @@ ],

null,
null,
null
],
"mappings": ";;;;;iBAqBgBA,MAAMA;;;;;iBCGNC,SAASA;;;;;iBCTTC,KAAKA;;;;;iBASLC,SAASA",
"mappings": ";;;;;iBAqBgBA,MAAMA;;;;;iBCGNC,SAASA;cCXZC,YAAYA;;;;;;;;;;;;;;iBCETC,KAAKA;;;;;iBASLC,SAASA",
"ignoreList": []
}