normalize-exception
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -9,2 +9,7 @@ import{setErrorProperty}from"./descriptors.js"; | ||
export const normalizeCause=function(error,recurse){ | ||
@@ -11,0 +16,0 @@ if(!("cause"in error)){ |
@@ -75,5 +75,6 @@ import isPlainObj from"is-plain-obj"; | ||
typeof error.constructor.name!=="string"|| | ||
error.constructor.name===""); | ||
error.constructor.name===""|| | ||
error.constructor.prototype!==Object.getPrototypeOf(error)); | ||
}; | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "normalize-exception", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": "./build/src/main.js", |
@@ -135,2 +135,17 @@ [![Codecov](https://img.shields.io/codecov/c/github/ehmicky/normalize-exception.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/normalize-exception) | ||
## Mismatched constructor | ||
<!-- eslint-disable fp/no-delete --> | ||
```js | ||
try { | ||
const error = new TypeError('message') | ||
error.constructor = RangeError | ||
throw error | ||
} catch (error) { | ||
console.log(error.constructor) // RangeError | ||
console.log(normalizeException(error).constructor) // TypeError | ||
} | ||
``` | ||
## Missing stack | ||
@@ -137,0 +152,0 @@ |
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
34768
430
393