normalize-exception
Advanced tools
Comparing version 2.4.0 to 2.5.0
@@ -18,8 +18,8 @@ import{setErrorProperty}from"./descriptors.js"; | ||
const getStack=function(message="",name="Error"){ | ||
const StackError=getErrorClass(name); | ||
const{stack}=new StackError(message); | ||
return stack===undefined||stack===""? | ||
`${name}: ${message}`: | ||
stack.split("\n").filter(isNotInternalLine).join("\n"); | ||
return stack===undefined||stack===""?`${name}: ${message}`:stack; | ||
}; | ||
@@ -43,11 +43,2 @@ | ||
}; | ||
const isNotInternalLine=function(line){ | ||
return!line.includes(INTERNAL_LINE); | ||
}; | ||
const INTERNAL_LINE="normalize-exception"; | ||
//# sourceMappingURL=stack.js.map |
{ | ||
"name": "normalize-exception", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": "./build/src/main.js", |
@@ -363,2 +363,4 @@ [![Codecov](https://img.shields.io/codecov/c/github/ehmicky/normalize-exception.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/normalize-exception) | ||
error with its `cause` | ||
- [`set-error-message`](https://github.com/ehmicky/set-error-message): Properly | ||
update an error's message | ||
- [`set-error-props`](https://github.com/ehmicky/set-error-props): Properly | ||
@@ -365,0 +367,0 @@ update an error's properties |
401
35175
427