+1
-0
| 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, |
+7
-3
@@ -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 @@ } |
+7
-3
@@ -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 @@ } |
+5
-1
@@ -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 @@ } |
+10
-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": [] | ||
| } |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
35936
2.04%977
2.41%