Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2023-07-13 09:09:17 +00:00
parent 4fad06f438
commit 40a500c743
4168 changed files with 298222 additions and 374905 deletions

View file

@ -1,16 +1,19 @@
'use strict';
const indentString = require('indent-string');
const cleanStack = require('clean-stack');
import indentString from 'indent-string';
import cleanStack from 'clean-stack';
const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, '');
class AggregateError extends Error {
export default class AggregateError extends Error {
#errors;
name = 'AggregateError';
constructor(errors) {
if (!Array.isArray(errors)) {
throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);
}
errors = [...errors].map(error => {
errors = errors.map(error => {
if (error instanceof Error) {
return error;
}
@ -26,22 +29,16 @@ class AggregateError extends Error {
let message = errors
.map(error => {
// The `stack` property is not standardized, so we can't assume it exists
return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error);
return typeof error.stack === 'string' && error.stack.length > 0 ? cleanInternalStack(cleanStack(error.stack)) : String(error);
})
.join('\n');
message = '\n' + indentString(message, 4);
super(message);
this.name = 'AggregateError';
Object.defineProperty(this, '_errors', {value: errors});
this.#errors = errors;
}
* [Symbol.iterator]() {
for (const error of this._errors) {
yield error;
}
get errors() {
return this.#errors.slice();
}
}
module.exports = AggregateError;