@swagger-api/apidom-error 1.11.1 → 1.11.2

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,10 @@
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.11.2](https://github.com/swagger-api/apidom/compare/v1.11.1...v1.11.2) (2026-06-02)
7
+
8
+ **Note:** Version bump only for package @swagger-api/apidom-error
9
+
6
10
  ## [1.11.1](https://github.com/swagger-api/apidom/compare/v1.11.0...v1.11.1) (2026-05-12)
7
11
 
8
12
  **Note:** Version bump only for package @swagger-api/apidom-error
@@ -1,95 +1,85 @@
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
- }
26
- }
27
- }
28
- }
29
-
30
- class ApiDOMError extends Error {
31
- static [Symbol.hasInstance](instance) {
32
- return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(ApiDOMAggregateError, instance);
33
- }
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
- }
53
- }
54
- }
55
-
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);
77
- }
78
- }
79
- }
80
-
81
- class UnsupportedOperationError extends ApiDOMError {
82
- }
83
-
84
- class NotImplementedError extends UnsupportedOperationError {
85
- }
86
-
87
- exports.ApiDOMAggregateError = ApiDOMAggregateError;
88
- exports.ApiDOMError = ApiDOMError;
89
- exports.ApiDOMStructuredError = ApiDOMStructuredError;
90
- exports.NotImplementedError = NotImplementedError;
91
- exports.UnsupportedOperationError = UnsupportedOperationError;
92
-
93
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
94
-
95
- }));
1
+ (function(global, factory) {
2
+ 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 = {}));
3
+ })(this, function(exports) {
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
+ //#region src/ApiDOMAggregateError.ts
6
+ /**
7
+ * @public
8
+ */
9
+ var ApiDOMAggregateError = class extends AggregateError {
10
+ constructor(errors, message, options) {
11
+ super(errors, message, options);
12
+ this.name = this.constructor.name;
13
+ if (typeof message === "string") this.message = message;
14
+ if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, this.constructor);
15
+ else this.stack = new Error(message).stack;
16
+ /**
17
+ * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
18
+ * Node.js >= 16.9.0 supports error causes natively.
19
+ */
20
+ if (options != null && typeof options === "object" && Object.hasOwn(options, "cause") && !("cause" in this)) {
21
+ const { cause } = options;
22
+ this.cause = cause;
23
+ if (cause instanceof Error && "stack" in cause) this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
24
+ }
25
+ }
26
+ };
27
+ //#endregion
28
+ //#region src/ApiDOMError.ts
29
+ /**
30
+ * @public
31
+ */
32
+ var ApiDOMError = class extends Error {
33
+ static [Symbol.hasInstance](instance) {
34
+ return super[Symbol.hasInstance](instance) || Function.prototype[Symbol.hasInstance].call(ApiDOMAggregateError, instance);
35
+ }
36
+ constructor(message, options) {
37
+ super(message, options);
38
+ this.name = this.constructor.name;
39
+ if (typeof message === "string") this.message = message;
40
+ if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, this.constructor);
41
+ else this.stack = new Error(message).stack;
42
+ /**
43
+ * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
44
+ * Node.js is >= 16.9.0 supports error causes natively.
45
+ */
46
+ if (options != null && typeof options === "object" && Object.hasOwn(options, "cause") && !("cause" in this)) {
47
+ const { cause } = options;
48
+ this.cause = cause;
49
+ if (cause instanceof Error && "stack" in cause) this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
50
+ }
51
+ }
52
+ };
53
+ //#endregion
54
+ //#region src/ApiDOMStructuredError.ts
55
+ /**
56
+ * @public
57
+ */
58
+ var ApiDOMStructuredError = class extends ApiDOMError {
59
+ constructor(message, structuredOptions) {
60
+ super(message, structuredOptions);
61
+ if (structuredOptions != null && typeof structuredOptions === "object") {
62
+ const { cause, ...causelessOptions } = structuredOptions;
63
+ Object.assign(this, causelessOptions);
64
+ }
65
+ }
66
+ };
67
+ //#endregion
68
+ //#region src/UnsupportedOperationError.ts
69
+ /**
70
+ * @public
71
+ */
72
+ var UnsupportedOperationError = class extends ApiDOMError {};
73
+ //#endregion
74
+ //#region src/NotImplementedError.ts
75
+ /**
76
+ * @public
77
+ */
78
+ var NotImplementedError = class extends UnsupportedOperationError {};
79
+ //#endregion
80
+ exports.ApiDOMAggregateError = ApiDOMAggregateError;
81
+ exports.ApiDOMError = ApiDOMError;
82
+ exports.ApiDOMStructuredError = ApiDOMStructuredError;
83
+ exports.NotImplementedError = NotImplementedError;
84
+ exports.UnsupportedOperationError = UnsupportedOperationError;
85
+ });
@@ -1 +1,31 @@
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"})}));
1
+ (function(t, s) {
2
+ "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 = {});
3
+ })(this, (function(t) {
4
+ Object.defineProperty(t, Symbol.toStringTag, { value: "Module" });
5
+ var s = class extends AggregateError {
6
+ constructor(t, s, e) {
7
+ 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)) {
8
+ const { cause: t } = e;
9
+ this.cause = t, t instanceof Error && "stack" in t && (this.stack = `${this.stack}\nCAUSE: ${t.stack}`);
10
+ }
11
+ }
12
+ }, e = class extends Error {
13
+ static [Symbol.hasInstance](t) {
14
+ return super[Symbol.hasInstance](t) || Function.prototype[Symbol.hasInstance].call(s, t);
15
+ }
16
+ constructor(t, s) {
17
+ 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)) {
18
+ const { cause: t } = s;
19
+ this.cause = t, t instanceof Error && "stack" in t && (this.stack = `${this.stack}\nCAUSE: ${t.stack}`);
20
+ }
21
+ }
22
+ }, r = class extends e {};
23
+ t.ApiDOMAggregateError = s, t.ApiDOMError = e, t.ApiDOMStructuredError = class extends e {
24
+ constructor(t, s) {
25
+ if (super(t, s), null != s && "object" == typeof s) {
26
+ const { cause: t, ...e } = s;
27
+ Object.assign(this, e);
28
+ }
29
+ }
30
+ }, t.NotImplementedError = class extends r {}, t.UnsupportedOperationError = r;
31
+ }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swagger-api/apidom-error",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "description": "Backward compatible custom ApiDOM errors with causes.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -49,5 +49,5 @@
49
49
  "README.md",
50
50
  "CHANGELOG.md"
51
51
  ],
52
- "gitHead": "d5eeb79d3efa930929dc9b3378b36071be8ed44d"
52
+ "gitHead": "0ace20a29a3ed690af50b47734114fe06219dc20"
53
53
  }