Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aggregate-error

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aggregate-error - npm Package Compare versions

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc