aggregate-error
Advanced tools
Comparing version 4.0.1 to 5.0.0
10
index.js
import indentString from 'indent-string'; | ||
import cleanStack from 'clean-stack'; | ||
const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); | ||
const cleanInternalStack = stack => stack.replaceAll(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); | ||
@@ -30,6 +30,6 @@ export default class AggregateError extends Error { | ||
let message = errors | ||
.map(error => { | ||
.map(error => | ||
// The `stack` property is not standardized, so we can't assume it exists | ||
return typeof error.stack === 'string' && error.stack.length > 0 ? cleanInternalStack(cleanStack(error.stack)) : String(error); | ||
}) | ||
typeof error.stack === 'string' && error.stack.length > 0 ? cleanInternalStack(cleanStack(error.stack)) : String(error), | ||
) | ||
.join('\n'); | ||
@@ -43,4 +43,4 @@ message = '\n' + indentString(message, 4); | ||
get errors() { | ||
return this.#errors.slice(); | ||
return [...this.#errors]; | ||
} | ||
} |
{ | ||
"name": "aggregate-error", | ||
"version": "4.0.1", | ||
"version": "5.0.0", | ||
"description": "Create an error from multiple errors", | ||
@@ -14,9 +14,11 @@ "license": "MIT", | ||
"type": "module", | ||
"exports": "./index.js", | ||
"exports": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=18" | ||
}, | ||
"scripts": { | ||
"//test": "xo && ava && tsd", | ||
"test": "ava && tsd" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -38,10 +40,10 @@ "files": [ | ||
"dependencies": { | ||
"clean-stack": "^4.0.0", | ||
"clean-stack": "^5.2.0", | ||
"indent-string": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^3.15.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.38.2" | ||
"ava": "^5.3.1", | ||
"tsd": "^0.29.0", | ||
"xo": "^0.56.0" | ||
} | ||
} |
@@ -9,5 +9,5 @@ # aggregate-error | ||
```sh | ||
npm install aggregate-error | ||
``` | ||
$ npm install aggregate-error | ||
``` | ||
@@ -14,0 +14,0 @@ ## Usage |
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
6471
+ Addedclean-stack@5.2.0(transitive)
- Removedclean-stack@4.2.0(transitive)
Updatedclean-stack@^5.2.0