serialize-error
Advanced tools
Comparing version 11.0.1 to 11.0.2
@@ -113,3 +113,7 @@ import errorConstructors from './error-constructors.js'; | ||
if (!value || typeof value !== 'object') { | ||
to[key] = value; | ||
// Gracefully handle non-configurable errors like `DOMException`. | ||
try { | ||
to[key] = value; | ||
} catch {} | ||
continue; | ||
@@ -163,3 +167,4 @@ } | ||
// `JSON.stringify()` discards functions. We do too, unless a function is thrown directly. | ||
return `[Function: ${value.name ?? 'anonymous'}]`; | ||
// We intentionally use `||` because `.name` is an empty string for anonymous functions. | ||
return `[Function: ${value.name || 'anonymous'}]`; | ||
} | ||
@@ -166,0 +171,0 @@ |
{ | ||
"name": "serialize-error", | ||
"version": "11.0.1", | ||
"version": "11.0.2", | ||
"description": "Serialize/deserialize an error into a plain object", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
16741
339