@swagger-api/apidom-error 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.6.0](https://github.com/swagger-api/apidom/compare/v1.5.1...v1.6.0) (2026-02-27)
7
+
8
+ **Note:** Version bump only for package @swagger-api/apidom-error
9
+
10
+ ## [1.5.1](https://github.com/swagger-api/apidom/compare/v1.5.0...v1.5.1) (2026-02-19)
11
+
12
+ **Note:** Version bump only for package @swagger-api/apidom-error
13
+
6
14
  # [1.5.0](https://github.com/swagger-api/apidom/compare/v1.4.0...v1.5.0) (2026-02-16)
7
15
 
8
16
  **Note:** Version bump only for package @swagger-api/apidom-error
@@ -1,249 +1,95 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["apidomError"] = factory();
8
- else
9
- root["apidomError"] = factory();
10
- })(self, () => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 172:
16
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17
-
18
- __webpack_require__.r(__webpack_exports__);
19
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
21
- /* harmony export */ });
22
- /**
23
- * @public
24
- */
25
- class ApiDOMAggregateError extends AggregateError {
26
- constructor(errors, message, options) {
27
- super(errors, message, options);
28
- this.name = this.constructor.name;
29
- if (typeof message === 'string') {
30
- this.message = message;
31
- }
32
- if (typeof Error.captureStackTrace === 'function') {
33
- Error.captureStackTrace(this, this.constructor);
34
- } else {
35
- this.stack = new Error(message).stack;
36
- }
37
-
38
- /**
39
- * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
40
- * Node.js >= 16.9.0 supports error causes natively.
41
- */
42
- if (options != null && typeof options === 'object' && Object.hasOwn(options, 'cause') && !('cause' in this)) {
43
- const {
44
- cause
45
- } = options;
46
- this.cause = cause;
47
- if (cause instanceof Error && 'stack' in cause) {
48
- this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.apidomError = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ class ApiDOMAggregateError extends AggregateError {
8
+ constructor(errors, message, options) {
9
+ super(errors, message, options);
10
+ this.name = this.constructor.name;
11
+ if (typeof message === "string") {
12
+ this.message = message;
13
+ }
14
+ if (typeof Error.captureStackTrace === "function") {
15
+ Error.captureStackTrace(this, this.constructor);
16
+ } else {
17
+ this.stack = new Error(message).stack;
18
+ }
19
+ if (options != null && typeof options === "object" && Object.hasOwn(options, "cause") && !("cause" in this)) {
20
+ const { cause } = options;
21
+ this.cause = cause;
22
+ if (cause instanceof Error && "stack" in cause) {
23
+ this.stack = `${this.stack}
24
+ CAUSE: ${cause.stack}`;
25
+ }
49
26
  }
50
27
  }
51
28
  }
52
- }
53
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiDOMAggregateError);
54
-
55
- /***/ }),
56
-
57
- /***/ 428:
58
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
59
-
60
- __webpack_require__.r(__webpack_exports__);
61
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
62
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
63
- /* harmony export */ });
64
- /* harmony import */ var _UnsupportedOperationError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(537);
65
-
66
-
67
- /**
68
- * @public
69
- */
70
- class NotImplementedError extends _UnsupportedOperationError_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {}
71
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NotImplementedError);
72
-
73
- /***/ }),
74
-
75
- /***/ 537:
76
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
77
-
78
- __webpack_require__.r(__webpack_exports__);
79
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
80
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
81
- /* harmony export */ });
82
- /* harmony import */ var _ApiDOMError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
83
-
84
-
85
- /**
86
- * @public
87
- */
88
- class UnsupportedOperationError extends _ApiDOMError_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {}
89
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UnsupportedOperationError);
90
-
91
- /***/ }),
92
-
93
- /***/ 672:
94
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
95
-
96
- __webpack_require__.r(__webpack_exports__);
97
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
98
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
99
- /* harmony export */ });
100
- /* harmony import */ var _ApiDOMError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
101
-
102
- /**
103
- * @public
104
- */
105
- class ApiDOMStructuredError extends _ApiDOMError_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
106
- constructor(message, structuredOptions) {
107
- super(message, structuredOptions);
108
- if (structuredOptions != null && typeof structuredOptions === 'object') {
109
- const {
110
- cause,
111
- ...causelessOptions
112
- } = structuredOptions;
113
- Object.assign(this, causelessOptions);
114
- }
115
- }
116
- }
117
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiDOMStructuredError);
118
29
 
119
- /***/ }),
120
-
121
- /***/ 797:
122
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
123
-
124
- __webpack_require__.r(__webpack_exports__);
125
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
126
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
127
- /* harmony export */ });
128
- /* harmony import */ var _ApiDOMAggregateError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(172);
129
-
130
- /**
131
- * @public
132
- */
133
- class ApiDOMError extends Error {
134
- static [Symbol.hasInstance](instance) {
135
- // we want to ApiDOMAggregateError to act as if ApiDOMError was its superclass
136
- return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(_ApiDOMAggregateError_ts__WEBPACK_IMPORTED_MODULE_0__["default"], instance);
137
- }
138
- constructor(message, options) {
139
- super(message, options);
140
- this.name = this.constructor.name;
141
- if (typeof message === 'string') {
142
- this.message = message;
30
+ class ApiDOMError extends Error {
31
+ static [Symbol.hasInstance](instance) {
32
+ return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(ApiDOMAggregateError, instance);
143
33
  }
144
- if (typeof Error.captureStackTrace === 'function') {
145
- Error.captureStackTrace(this, this.constructor);
146
- } else {
147
- this.stack = new Error(message).stack;
34
+ constructor(message, options) {
35
+ super(message, options);
36
+ this.name = this.constructor.name;
37
+ if (typeof message === "string") {
38
+ this.message = message;
39
+ }
40
+ if (typeof Error.captureStackTrace === "function") {
41
+ Error.captureStackTrace(this, this.constructor);
42
+ } else {
43
+ this.stack = new Error(message).stack;
44
+ }
45
+ if (options != null && typeof options === "object" && Object.hasOwn(options, "cause") && !("cause" in this)) {
46
+ const { cause } = options;
47
+ this.cause = cause;
48
+ if (cause instanceof Error && "stack" in cause) {
49
+ this.stack = `${this.stack}
50
+ CAUSE: ${cause.stack}`;
51
+ }
52
+ }
148
53
  }
54
+ }
149
55
 
150
- /**
151
- * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
152
- * Node.js is >= 16.9.0 supports error causes natively.
153
- */
154
- if (options != null && typeof options === 'object' && Object.hasOwn(options, 'cause') && !('cause' in this)) {
155
- const {
156
- cause
157
- } = options;
158
- this.cause = cause;
159
- if (cause instanceof Error && 'stack' in cause) {
160
- this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
56
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
57
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
58
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
59
+ var __objRest = (source, exclude) => {
60
+ var target = {};
61
+ for (var prop in source)
62
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
63
+ target[prop] = source[prop];
64
+ if (source != null && __getOwnPropSymbols)
65
+ for (var prop of __getOwnPropSymbols(source)) {
66
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
67
+ target[prop] = source[prop];
68
+ }
69
+ return target;
70
+ };
71
+ class ApiDOMStructuredError extends ApiDOMError {
72
+ constructor(message, structuredOptions) {
73
+ super(message, structuredOptions);
74
+ if (structuredOptions != null && typeof structuredOptions === "object") {
75
+ const _a = structuredOptions, { cause } = _a, causelessOptions = __objRest(_a, ["cause"]);
76
+ Object.assign(this, causelessOptions);
161
77
  }
162
78
  }
163
79
  }
164
- }
165
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiDOMError);
166
-
167
- /***/ })
168
-
169
- /******/ });
170
- /************************************************************************/
171
- /******/ // The module cache
172
- /******/ var __webpack_module_cache__ = {};
173
- /******/
174
- /******/ // The require function
175
- /******/ function __webpack_require__(moduleId) {
176
- /******/ // Check if module is in cache
177
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
178
- /******/ if (cachedModule !== undefined) {
179
- /******/ return cachedModule.exports;
180
- /******/ }
181
- /******/ // Create a new module (and put it into the cache)
182
- /******/ var module = __webpack_module_cache__[moduleId] = {
183
- /******/ // no module.id needed
184
- /******/ // no module.loaded needed
185
- /******/ exports: {}
186
- /******/ };
187
- /******/
188
- /******/ // Execute the module function
189
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
190
- /******/
191
- /******/ // Return the exports of the module
192
- /******/ return module.exports;
193
- /******/ }
194
- /******/
195
- /************************************************************************/
196
- /******/ /* webpack/runtime/define property getters */
197
- /******/ (() => {
198
- /******/ // define getter functions for harmony exports
199
- /******/ __webpack_require__.d = (exports, definition) => {
200
- /******/ for(var key in definition) {
201
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
202
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
203
- /******/ }
204
- /******/ }
205
- /******/ };
206
- /******/ })();
207
- /******/
208
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
209
- /******/ (() => {
210
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
211
- /******/ })();
212
- /******/
213
- /******/ /* webpack/runtime/make namespace object */
214
- /******/ (() => {
215
- /******/ // define __esModule on exports
216
- /******/ __webpack_require__.r = (exports) => {
217
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
218
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
219
- /******/ }
220
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
221
- /******/ };
222
- /******/ })();
223
- /******/
224
- /************************************************************************/
225
- var __webpack_exports__ = {};
226
- __webpack_require__.r(__webpack_exports__);
227
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
228
- /* harmony export */ ApiDOMAggregateError: () => (/* reexport safe */ _ApiDOMAggregateError_ts__WEBPACK_IMPORTED_MODULE_1__["default"]),
229
- /* harmony export */ ApiDOMError: () => (/* reexport safe */ _ApiDOMError_ts__WEBPACK_IMPORTED_MODULE_0__["default"]),
230
- /* harmony export */ ApiDOMStructuredError: () => (/* reexport safe */ _ApiDOMStructuredError_ts__WEBPACK_IMPORTED_MODULE_2__["default"]),
231
- /* harmony export */ NotImplementedError: () => (/* reexport safe */ _NotImplementedError_ts__WEBPACK_IMPORTED_MODULE_4__["default"]),
232
- /* harmony export */ UnsupportedOperationError: () => (/* reexport safe */ _UnsupportedOperationError_ts__WEBPACK_IMPORTED_MODULE_3__["default"])
233
- /* harmony export */ });
234
- /* harmony import */ var _ApiDOMError_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
235
- /* harmony import */ var _ApiDOMAggregateError_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172);
236
- /* harmony import */ var _ApiDOMStructuredError_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(672);
237
- /* harmony import */ var _UnsupportedOperationError_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(537);
238
- /* harmony import */ var _NotImplementedError_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(428);
239
- // base error classes
240
80
 
81
+ class UnsupportedOperationError extends ApiDOMError {
82
+ }
241
83
 
84
+ class NotImplementedError extends UnsupportedOperationError {
85
+ }
242
86
 
243
- // generic custom error classes
87
+ exports.ApiDOMAggregateError = ApiDOMAggregateError;
88
+ exports.ApiDOMError = ApiDOMError;
89
+ exports.ApiDOMStructuredError = ApiDOMStructuredError;
90
+ exports.NotImplementedError = NotImplementedError;
91
+ exports.UnsupportedOperationError = UnsupportedOperationError;
244
92
 
93
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
245
94
 
246
- /******/ return __webpack_exports__;
247
- /******/ })()
248
- ;
249
- });
95
+ }));
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apidomError=e():t.apidomError=e()}(self,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ApiDOMAggregateError:()=>s,ApiDOMError:()=>c,ApiDOMStructuredError:()=>n,NotImplementedError:()=>i,UnsupportedOperationError:()=>a});class r 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}`)}}}const s=r;class o extends Error{static[Symbol.hasInstance](t){return super[Symbol.hasInstance](t)||Function.prototype[Symbol.hasInstance].call(s,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}`)}}}const c=o;const n=class extends c{constructor(t,e){if(super(t,e),null!=e&&"object"==typeof e){const{cause:t,...r}=e;Object.assign(this,r)}}};const a=class extends c{};const i=class extends a{};return e})()));
1
+ !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"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swagger-api/apidom-error",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Backward compatible custom ApiDOM errors with causes.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -17,10 +17,10 @@
17
17
  },
18
18
  "types": "./types/apidom-error.d.ts",
19
19
  "scripts": {
20
- "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
20
+ "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-6} typescript:declaration build:es build:cjs build:umd:browser",
21
21
  "build:es": "cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'",
22
22
  "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir src --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'",
23
- "build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
23
+ "build:umd:browser": "vite build",
24
24
  "lint": "eslint ./",
25
25
  "lint:fix": "eslint ./ --fix",
26
26
  "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' ./dist ./types",
@@ -49,5 +49,5 @@
49
49
  "README.md",
50
50
  "CHANGELOG.md"
51
51
  ],
52
- "gitHead": "4bfa97c2350c1c3daa6a8a5ed002786f066b7729"
52
+ "gitHead": "bcac0ef25e9689b04d97e49151b0854be9fc6613"
53
53
  }