Comparing version 4.3.3 to 5.0.0
{ | ||
"name": "devalue", | ||
"description": "Gets the job done when JSON.stringify can't", | ||
"version": "4.3.3", | ||
"version": "5.0.0", | ||
"repository": "Rich-Harris/devalue", | ||
@@ -6,0 +6,0 @@ "exports": { |
import { | ||
DevalueError, | ||
enumerable_symbols, | ||
get_type, | ||
@@ -146,3 +147,3 @@ is_plain_object, | ||
if (Object.getOwnPropertySymbols(thing).length > 0) { | ||
if (enumerable_symbols(thing).length > 0) { | ||
throw new DevalueError( | ||
@@ -149,0 +150,0 @@ `Cannot stringify POJOs with symbolic keys`, |
import { | ||
DevalueError, | ||
enumerable_symbols, | ||
escaped, | ||
@@ -92,3 +93,3 @@ get_type, | ||
if (Object.getOwnPropertySymbols(thing).length > 0) { | ||
if (enumerable_symbols(thing).length > 0) { | ||
throw new DevalueError( | ||
@@ -95,0 +96,0 @@ `Cannot stringify POJOs with symbolic keys`, |
@@ -100,1 +100,8 @@ /** @type {Record<string, string>} */ | ||
} | ||
/** @param {Record<string | symbol, any>} object */ | ||
export function enumerable_symbols(object) { | ||
return Object.getOwnPropertySymbols(object).filter( | ||
(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable | ||
); | ||
} |
Sorry, the diff of this file is not supported yet
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
25880
659