@swagger-api/apidom-error
Advanced tools
+4
-0
@@ -6,2 +6,6 @@ # Change Log | ||
| ## [1.11.2](https://github.com/swagger-api/apidom/compare/v1.11.1...v1.11.2) (2026-06-02) | ||
| **Note:** Version bump only for package @swagger-api/apidom-error | ||
| ## [1.11.1](https://github.com/swagger-api/apidom/compare/v1.11.0...v1.11.1) (2026-05-12) | ||
@@ -8,0 +12,0 @@ |
@@ -1,95 +0,85 @@ | ||
| (function (global, factory) { | ||
| typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
| typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
| (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.apidomError = {})); | ||
| })(this, (function (exports) { 'use strict'; | ||
| class ApiDOMAggregateError extends AggregateError { | ||
| 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; | ||
| } | ||
| 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} | ||
| CAUSE: ${cause.stack}`; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| class ApiDOMError extends Error { | ||
| static [Symbol.hasInstance](instance) { | ||
| return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(ApiDOMAggregateError, instance); | ||
| } | ||
| constructor(message, options) { | ||
| super(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; | ||
| } | ||
| 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} | ||
| CAUSE: ${cause.stack}`; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
| var __objRest = (source, exclude) => { | ||
| var target = {}; | ||
| for (var prop in source) | ||
| if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) | ||
| target[prop] = source[prop]; | ||
| if (source != null && __getOwnPropSymbols) | ||
| for (var prop of __getOwnPropSymbols(source)) { | ||
| if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) | ||
| target[prop] = source[prop]; | ||
| } | ||
| return target; | ||
| }; | ||
| class ApiDOMStructuredError extends ApiDOMError { | ||
| constructor(message, structuredOptions) { | ||
| super(message, structuredOptions); | ||
| if (structuredOptions != null && typeof structuredOptions === "object") { | ||
| const _a = structuredOptions, { cause } = _a, causelessOptions = __objRest(_a, ["cause"]); | ||
| Object.assign(this, causelessOptions); | ||
| } | ||
| } | ||
| } | ||
| class UnsupportedOperationError extends ApiDOMError { | ||
| } | ||
| class NotImplementedError extends UnsupportedOperationError { | ||
| } | ||
| exports.ApiDOMAggregateError = ApiDOMAggregateError; | ||
| exports.ApiDOMError = ApiDOMError; | ||
| exports.ApiDOMStructuredError = ApiDOMStructuredError; | ||
| exports.NotImplementedError = NotImplementedError; | ||
| exports.UnsupportedOperationError = UnsupportedOperationError; | ||
| Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| })); | ||
| (function(global, factory) { | ||
| typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.apidomError = {})); | ||
| })(this, function(exports) { | ||
| Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); | ||
| //#region src/ApiDOMAggregateError.ts | ||
| /** | ||
| * @public | ||
| */ | ||
| var ApiDOMAggregateError = class extends AggregateError { | ||
| 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}`; | ||
| } | ||
| } | ||
| }; | ||
| //#endregion | ||
| //#region src/ApiDOMError.ts | ||
| /** | ||
| * @public | ||
| */ | ||
| var ApiDOMError = class extends Error { | ||
| static [Symbol.hasInstance](instance) { | ||
| return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(ApiDOMAggregateError, instance); | ||
| } | ||
| constructor(message, options) { | ||
| super(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 is >= 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}`; | ||
| } | ||
| } | ||
| }; | ||
| //#endregion | ||
| //#region src/ApiDOMStructuredError.ts | ||
| /** | ||
| * @public | ||
| */ | ||
| var ApiDOMStructuredError = class extends ApiDOMError { | ||
| constructor(message, structuredOptions) { | ||
| super(message, structuredOptions); | ||
| if (structuredOptions != null && typeof structuredOptions === "object") { | ||
| const { cause, ...causelessOptions } = structuredOptions; | ||
| Object.assign(this, causelessOptions); | ||
| } | ||
| } | ||
| }; | ||
| //#endregion | ||
| //#region src/UnsupportedOperationError.ts | ||
| /** | ||
| * @public | ||
| */ | ||
| var UnsupportedOperationError = class extends ApiDOMError {}; | ||
| //#endregion | ||
| //#region src/NotImplementedError.ts | ||
| /** | ||
| * @public | ||
| */ | ||
| var NotImplementedError = class extends UnsupportedOperationError {}; | ||
| //#endregion | ||
| exports.ApiDOMAggregateError = ApiDOMAggregateError; | ||
| exports.ApiDOMError = ApiDOMError; | ||
| exports.ApiDOMStructuredError = ApiDOMStructuredError; | ||
| exports.NotImplementedError = NotImplementedError; | ||
| exports.UnsupportedOperationError = UnsupportedOperationError; | ||
| }); |
@@ -1,1 +0,31 @@ | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).apidomError={})}(this,(function(t){"use strict";class e extends AggregateError{constructor(t,e,r){if(super(t,e,r),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=r&&"object"==typeof r&&Object.hasOwn(r,"cause")&&!("cause"in this)){const{cause:t}=r;this.cause=t,t instanceof Error&&"stack"in t&&(this.stack=`${this.stack}\nCAUSE: ${t.stack}`)}}}class r extends Error{static[Symbol.hasInstance](t){return super[Symbol.hasInstance](t)||Function.prototype[Symbol.hasInstance].call(e,t)}constructor(t,e){if(super(t,e),this.name=this.constructor.name,"string"==typeof t&&(this.message=t),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack,null!=e&&"object"==typeof e&&Object.hasOwn(e,"cause")&&!("cause"in this)){const{cause:t}=e;this.cause=t,t instanceof Error&&"stack"in t&&(this.stack=`${this.stack}\nCAUSE: ${t.stack}`)}}}var s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;class n extends r{}t.ApiDOMAggregateError=e,t.ApiDOMError=r,t.ApiDOMStructuredError=class extends r{constructor(t,e){if(super(t,e),null!=e&&"object"==typeof e){const t=e,{cause:r}=t,n=((t,e)=>{var r={};for(var n in t)o.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&s)for(var n of s(t))e.indexOf(n)<0&&c.call(t,n)&&(r[n]=t[n]);return r})(t,["cause"]);Object.assign(this,n)}}},t.NotImplementedError=class extends n{},t.UnsupportedOperationError=n,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})})); | ||
| (function(t, s) { | ||
| "object" == typeof exports && "undefined" != typeof module ? s(exports) : "function" == typeof define && define.amd ? define(["exports"], s) : s((t = "undefined" != typeof globalThis ? globalThis : t || self).apidomError = {}); | ||
| })(this, (function(t) { | ||
| Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }); | ||
| var s = class extends AggregateError { | ||
| constructor(t, s, e) { | ||
| if (super(t, s, e), this.name = this.constructor.name, "string" == typeof s && (this.message = s), "function" == typeof Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error(s).stack, null != e && "object" == typeof e && Object.hasOwn(e, "cause") && !("cause" in this)) { | ||
| const { cause: t } = e; | ||
| this.cause = t, t instanceof Error && "stack" in t && (this.stack = `${this.stack}\nCAUSE: ${t.stack}`); | ||
| } | ||
| } | ||
| }, e = class extends Error { | ||
| static [Symbol.hasInstance](t) { | ||
| return super[Symbol.hasInstance](t) || Function.prototype[Symbol.hasInstance].call(s, t); | ||
| } | ||
| constructor(t, s) { | ||
| if (super(t, s), this.name = this.constructor.name, "string" == typeof t && (this.message = t), "function" == typeof Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error(t).stack, null != s && "object" == typeof s && Object.hasOwn(s, "cause") && !("cause" in this)) { | ||
| const { cause: t } = s; | ||
| this.cause = t, t instanceof Error && "stack" in t && (this.stack = `${this.stack}\nCAUSE: ${t.stack}`); | ||
| } | ||
| } | ||
| }, r = class extends e {}; | ||
| t.ApiDOMAggregateError = s, t.ApiDOMError = e, t.ApiDOMStructuredError = class extends e { | ||
| constructor(t, s) { | ||
| if (super(t, s), null != s && "object" == typeof s) { | ||
| const { cause: t, ...e } = s; | ||
| Object.assign(this, e); | ||
| } | ||
| } | ||
| }, t.NotImplementedError = class extends r {}, t.UnsupportedOperationError = r; | ||
| })); |
+2
-2
| { | ||
| "name": "@swagger-api/apidom-error", | ||
| "version": "1.11.1", | ||
| "version": "1.11.2", | ||
| "description": "Backward compatible custom ApiDOM errors with causes.", | ||
@@ -52,3 +52,3 @@ "publishConfig": { | ||
| ], | ||
| "gitHead": "d5eeb79d3efa930929dc9b3378b36071be8ed44d" | ||
| "gitHead": "0ace20a29a3ed690af50b47734114fe06219dc20" | ||
| } |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
378
8.93%1
-50%70797
-0.07%