UNPKG

891 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.isAggregateError = exports.AggregateError = void 0;
4let AggregateErrorImpl;
5exports.AggregateError = AggregateErrorImpl;
6if (typeof AggregateError === 'undefined') {
7 class AggregateErrorClass extends Error {
8 constructor(errors, message = '') {
9 super(message);
10 this.errors = errors;
11 this.name = 'AggregateError';
12 Error.captureStackTrace(this, AggregateErrorClass);
13 }
14 }
15 exports.AggregateError = AggregateErrorImpl = function (errors, message) {
16 return new AggregateErrorClass(errors, message);
17 };
18}
19else {
20 exports.AggregateError = AggregateErrorImpl = AggregateError;
21}
22function isAggregateError(error) {
23 return 'errors' in error && Array.isArray(error['errors']);
24}
25exports.isAggregateError = isAggregateError;