All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.ApiDOMAggregateError.cjs Maven / Gradle / Ivy

The newest version!
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
exports.__esModule = true;
exports.default = void 0;
var _aggregateError = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/aggregate-error"));
class ApiDOMAggregateError extends _aggregateError.default {
  constructor(errors, message, options) {
    super(errors, message, options);
    this.name = this.constructor.name;
    if (typeof message === 'string') {
      this.message = message;
    }
    if (typeof Error.captureStackTrace === 'function') {
      Error.captureStackTrace(this, this.constructor);
    } else {
      this.stack = new Error(message).stack;
    }

    /**
     * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
     * Node.js >= 16.9.0 supports error causes natively.
     */
    if (options != null && typeof options === 'object' && Object.hasOwn(options, 'cause') && !('cause' in this)) {
      const {
        cause
      } = options;
      this.cause = cause;
      if (cause instanceof Error && 'stack' in cause) {
        this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
      }
    }
  }
}
var _default = exports.default = ApiDOMAggregateError;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy