@swagger-api/apidom-error 0.81.0 → 0.82.1

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.
@@ -1 +1 @@
1
- !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.apidomError=n():t.apidomError=n()}(self,(()=>(()=>{"use strict";var t={d:(n,r)=>{for(var e in r)t.o(r,e)&&!t.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:r[e]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};function r(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function e(t){return function n(e){return 0===arguments.length||r(e)?n:t.apply(this,arguments)}}function o(t){return function n(o,u){switch(arguments.length){case 0:return n;case 1:return r(o)?n:e((function(n){return t(o,n)}));default:return r(o)&&r(u)?n:r(o)?e((function(n){return t(n,u)})):r(u)?e((function(n){return t(o,n)})):t(o,u)}}}t.r(n),t.d(n,{ApiDOMAggregateError:()=>$t,ApiDOMError:()=>Gt,ApiDOMStructuredError:()=>Ht,NotImplementedError:()=>Wt,UnsupportedOperationError:()=>Lt});const u=e((function(t){return null==t}));var c=o((function(t,n){return!u(n)&&t in n}));const a=c;function i(t,n){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(t){return n.apply(this,arguments)};case 2:return function(t,r){return n.apply(this,arguments)};case 3:return function(t,r,e){return n.apply(this,arguments)};case 4:return function(t,r,e,o){return n.apply(this,arguments)};case 5:return function(t,r,e,o,u){return n.apply(this,arguments)};case 6:return function(t,r,e,o,u,c){return n.apply(this,arguments)};case 7:return function(t,r,e,o,u,c,a){return n.apply(this,arguments)};case 8:return function(t,r,e,o,u,c,a,i){return n.apply(this,arguments)};case 9:return function(t,r,e,o,u,c,a,i,s){return n.apply(this,arguments)};case 10:return function(t,r,e,o,u,c,a,i,s,f){return n.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function s(t,n){return function(){return n.call(this,t.apply(this,arguments))}}function f(t){return function n(u,c,a){switch(arguments.length){case 0:return n;case 1:return r(u)?n:o((function(n,r){return t(u,n,r)}));case 2:return r(u)&&r(c)?n:r(u)?o((function(n,r){return t(n,c,r)})):r(c)?o((function(n,r){return t(u,n,r)})):e((function(n){return t(u,c,n)}));default:return r(u)&&r(c)&&r(a)?n:r(u)&&r(c)?o((function(n,r){return t(n,r,a)})):r(u)&&r(a)?o((function(n,r){return t(n,c,r)})):r(c)&&r(a)?o((function(n,r){return t(u,n,r)})):r(u)?e((function(n){return t(n,c,a)})):r(c)?e((function(n){return t(u,n,a)})):r(a)?e((function(n){return t(u,c,n)})):t(u,c,a)}}}const l=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)};function p(t){return"[object String]"===Object.prototype.toString.call(t)}const y=e((function(t){return!!l(t)||!!t&&("object"==typeof t&&(!p(t)&&(0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))}));var h="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function g(t,n,r){return function(e,o,u){if(y(u))return t(e,o,u);if(null==u)return o;if("function"==typeof u["fantasy-land/reduce"])return n(e,o,u,"fantasy-land/reduce");if(null!=u[h])return r(e,o,u[h]());if("function"==typeof u.next)return r(e,o,u);if("function"==typeof u.reduce)return n(e,o,u,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function d(t,n,r){for(var e=0,o=r.length;e<o;){if((n=t["@@transducer/step"](n,r[e]))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}const b=o((function(t,n){return i(t.length,(function(){return t.apply(n,arguments)}))}));function v(t,n,r){for(var e=r.next();!e.done;){if((n=t["@@transducer/step"](n,e.value))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function m(t,n,r,e){return t["@@transducer/result"](r[e](b(t["@@transducer/step"],t),n))}const j=g(d,m,v);var O=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},t}();const S=f((function(t,n,r){return j("function"==typeof t?new O(t):t,n,r)}));function A(t,n){return function(){var r=arguments.length;if(0===r)return n();var e=arguments[r-1];return l(e)||"function"!=typeof e[t]?n.apply(this,arguments):e[t].apply(e,Array.prototype.slice.call(arguments,0,r-1))}}const w=e(A("tail",f(A("slice",(function(t,n,r){return Array.prototype.slice.call(r,t,n)})))(1,1/0)));function E(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return i(arguments[0].length,S(s,arguments[0],w(arguments)))}const x=e((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));const k="function"==typeof Object.is?Object.is:function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n};var U=function(t,n){switch(arguments.length){case 0:return U;case 1:return function n(r){return 0===arguments.length?n:k(t,r)};default:return k(t,n)}};const T=U;function F(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function q(t,n,r){for(var e=0,o=r.length;e<o;){if(t(n,r[e]))return!0;e+=1}return!1}function C(t,n){return Object.prototype.hasOwnProperty.call(n,t)}var I=Object.prototype.toString;const M=function(){return"[object Arguments]"===I.call(arguments)?function(t){return"[object Arguments]"===I.call(t)}:function(t){return C("callee",t)}}();var N=!{toString:null}.propertyIsEnumerable("toString"),P=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],D=function(){return arguments.propertyIsEnumerable("length")}(),B=function(t,n){for(var r=0;r<t.length;){if(t[r]===n)return!0;r+=1}return!1},$="function"!=typeof Object.keys||D?e((function(t){if(Object(t)!==t)return[];var n,r,e=[],o=D&&M(t);for(n in t)!C(n,t)||o&&"length"===n||(e[e.length]=n);if(N)for(r=P.length-1;r>=0;)C(n=P[r],t)&&!B(e,n)&&(e[e.length]=n),r-=1;return e})):e((function(t){return Object(t)!==t?[]:Object.keys(t)}));const z=$;function G(t,n,r,e){var o=F(t);function u(t,n){return _(t,n,r.slice(),e.slice())}return!q((function(t,n){return!q(u,n,t)}),F(n),o)}function _(t,n,r,e){if(k(t,n))return!0;var o,u,c=x(t);if(c!==x(n))return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(c){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(o=t.constructor,null==(u=String(o).match(/^function (\w*)/))?"":u[1]))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!k(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!k(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var a=r.length-1;a>=0;){if(r[a]===t)return e[a]===n;a-=1}switch(c){case"Map":return t.size===n.size&&G(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size===n.size&&G(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=z(t);if(i.length!==z(n).length)return!1;var s=r.concat([t]),f=e.concat([n]);for(a=i.length-1;a>=0;){var l=i[a];if(!C(l,n)||!_(n[l],t[l],s,f))return!1;a-=1}return!0}const R=o((function(t,n){return _(t,n,[],[])}));function H(t,n){return function(t,n,r){var e,o;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;r<t.length;){if(0===(o=t[r])&&1/o===e)return r;r+=1}return-1}if(n!=n){for(;r<t.length;){if("number"==typeof(o=t[r])&&o!=o)return r;r+=1}return-1}return t.indexOf(n,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;r<t.length;){if(R(t[r],n))return r;r+=1}return-1}(n,t,0)>=0}function L(t,n){for(var r=0,e=n.length,o=Array(e);r<e;)o[r]=t(n[r]),r+=1;return o}function W(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var X=function(t){return(t<10?"0":"")+t};const Y="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+X(t.getUTCMonth()+1)+"-"+X(t.getUTCDate())+"T"+X(t.getUTCHours())+":"+X(t.getUTCMinutes())+":"+X(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function Z(t,n,r){for(var e=0,o=r.length;e<o;)n=t(n,r[e]),e+=1;return n}function J(t,n,r){return function(){if(0===arguments.length)return r();var e=arguments[arguments.length-1];if(!l(e)){for(var o=0;o<t.length;){if("function"==typeof e[t[o]])return e[t[o]].apply(e,Array.prototype.slice.call(arguments,0,-1));o+=1}if(function(t){return null!=t&&"function"==typeof t["@@transducer/step"]}(e))return n.apply(null,Array.prototype.slice.call(arguments,0,-1))(e)}return r.apply(this,arguments)}}const K=function(){return this.xf["@@transducer/init"]()},Q=function(t){return this.xf["@@transducer/result"](t)};var V=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=K,t.prototype["@@transducer/result"]=Q,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},t}();function tt(t){return function(n){return new V(t,n)}}const nt=o(J(["fantasy-land/filter","filter"],tt,(function(t,n){return r=n,"[object Object]"===Object.prototype.toString.call(r)?Z((function(r,e){return t(n[e])&&(r[e]=n[e]),r}),{},z(n)):function(t,n){for(var r=0,e=n.length,o=[];r<e;)t(n[r])&&(o[o.length]=n[r]),r+=1;return o}(t,n);var r})));const rt=o((function(t,n){return nt((r=t,function(){return!r.apply(this,arguments)}),n);var r}));function et(t,n){var r=function(r){var e=n.concat([t]);return H(r,e)?"<Circular>":et(r,e)},e=function(t,n){return L((function(n){return W(n)+": "+r(t[n])}),n.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+L(r,t).join(", ")+"))";case"[object Array]":return"["+L(r,t).concat(e(t,rt((function(t){return/^\d+$/.test(t)}),z(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):W(Y(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+r(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return"object"==typeof t?"new String("+r(t.valueOf())+")":W(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var o=t.toString();if("[object Object]"!==o)return o}return"{"+e(t,z(t)).join(", ")+"}"}}const ot=e((function(t){return et(t,[])})),ut=Number.isInteger||function(t){return t<<0===t};const ct=o((function(t,n){var r=t<0?n.length+t:t;return p(n)?n.charAt(r):n[r]}));const at=o((function(t,n){return t.map((function(t){for(var r,e=n,o=0;o<t.length;){if(null==e)return;r=t[o],e=ut(r)?ct(r,e):e[r],o+=1}return e}))}));const it=o((function(t,n){return at([t],n)[0]}));const st=f((function(t,n,r){return t(it(n,r))}));const ft=o((function(t,n){return t&&n}));function lt(t,n,r){for(var e=r.next();!e.done;)n=t(n,e.value),e=r.next();return n}function pt(t,n,r,e){return r[e](t,n)}const yt=g(Z,pt,lt);var ht=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=K,t.prototype["@@transducer/result"]=Q,t.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))},t}();const gt=function(t){return function(n){return new ht(t,n)}};function dt(t,n,e){return function(){for(var o=[],u=0,c=t,a=0,s=!1;a<n.length||u<arguments.length;){var f;a<n.length&&(!r(n[a])||u>=arguments.length)?f=n[a]:(f=arguments[u],u+=1),o[a]=f,r(f)?s=!0:c-=1,a+=1}return!s&&c<=0?e.apply(this,o):i(Math.max(0,c),dt(t,o,e))}}const bt=o((function(t,n){return 1===t?e(n):i(t,dt(t,[],n))}));const vt=o(J(["fantasy-land/map","map"],gt,(function(t,n){switch(Object.prototype.toString.call(n)){case"[object Function]":return bt(n.length,(function(){return t.call(this,n.apply(this,arguments))}));case"[object Object]":return Z((function(r,e){return r[e]=t(n[e]),r}),{},z(n));default:return L(t,n)}})));const mt=o((function(t,n){return"function"==typeof n["fantasy-land/ap"]?n["fantasy-land/ap"](t):"function"==typeof t.ap?t.ap(n):"function"==typeof t?function(r){return t(r)(n(r))}:yt((function(t,r){return function(t,n){var r;n=n||[];var e=(t=t||[]).length,o=n.length,u=[];for(r=0;r<e;)u[u.length]=t[r],r+=1;for(r=0;r<o;)u[u.length]=n[r],r+=1;return u}(t,vt(r,n))}),[],t)}));const jt=o((function(t,n){var r=bt(t,n);return bt(t,(function(){return Z(mt,vt(r,arguments[0]),Array.prototype.slice.call(arguments,1))}))}));const Ot=e((function(t){return jt(t.length,t)}));var St=o((function(t,n){return function(t){var n=Object.prototype.toString.call(t);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n}(t)?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:Ot(ft)(t,n)}));const At=St;const wt=R(null);var Et=Ot(e((function(t){return!t})))(wt);function xt(t){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(t)}const kt=bt(1,At(Et,(function(t){return"object"===xt(t)})));const Ut=o((function(t,n){if(t===n)return n;function r(t,n){if(t>n!=n>t)return n>t?n:t}var e=r(t,n);if(void 0!==e)return e;var o=r(typeof t,typeof n);if(void 0!==o)return o===typeof t?t:n;var u=ot(t),c=r(u,ot(n));return void 0!==c&&c===u?t:n}));const Tt=o((function(t,n){if(null!=n)return ut(t)?ct(t,n):n[t]}));const Ft=o((function(t,n){return vt(Tt(t),n)}));const qt=e((function(t){return bt(S(Ut,0,Ft("length",t)),(function(){for(var n=0,r=t.length;n<r;){if(t[n].apply(this,arguments))return!0;n+=1}return!1}))}));const Ct=bt(1,E(x,T("GeneratorFunction")));const It=bt(1,E(x,T("AsyncFunction")));const Mt=qt([E(x,T("Function")),Ct,It]);var Nt=E(x,T("Object")),Pt=st(At(Mt,E(ot,R(ot(Object)))),["constructor"]);const Dt=bt(1,(function(t){if(!kt(t)||!Nt(t))return!1;var n=Object.getPrototypeOf(t);return!!wt(n)||Pt(n)}));class Bt extends AggregateError{constructor(t,n,r){if(super(t,n,r),this.name=this.constructor.name,"string"==typeof n&&(this.message=n),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(n).stack,Dt(r)&&a("cause",r)&&!a("cause",this)){const{cause:t}=r;this.cause=t,t instanceof Error&&a("stack",t)&&(this.stack=`${this.stack}\nCAUSE: ${t?.stack}`)}}}const $t=Bt;class zt extends Error{static[Symbol.hasInstance](t){return super[Symbol.hasInstance](t)||Function.prototype[Symbol.hasInstance].call($t,t)}constructor(t,n){if(super(t,n),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,Dt(n)&&a("cause",n)&&!a("cause",this)){const{cause:t}=n;this.cause=t,t instanceof Error&&a("stack",t)&&(this.stack=`${this.stack}\nCAUSE: ${t?.stack}`)}}}const Gt=zt;var _t=o((function(t,n){for(var r={},e={},o=0,u=t.length;o<u;)e[t[o]]=1,o+=1;for(var c in n)e.hasOwnProperty(c)||(r[c]=n[c]);return r}));const Rt=_t;const Ht=class extends Gt{constructor(t,n){super(t,n),void 0!==n&&Object.assign(this,Rt(["cause"],n))}};const Lt=class extends Gt{};const Wt=class extends Lt{};return n})()));
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,6 +1,4 @@
1
1
  import _AggregateError from "@babel/runtime-corejs3/core-js/aggregate-error";
2
- import { isPlainObject } from 'ramda-adjunct';
3
- import { hasIn } from 'ramda';
4
2
  class ApiDOMAggregateError extends _AggregateError {
5
3
  constructor(errors, message, options) {
6
4
  super(errors, message, options);
@@ -16,15 +14,15 @@ class ApiDOMAggregateError extends _AggregateError {
16
14
 
17
15
  /**
18
16
  * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
19
- * Node.js is >= 16.9.0 supports error causes natively.
17
+ * Node.js >= 16.9.0 supports error causes natively.
20
18
  */
21
- if (isPlainObject(options) && hasIn('cause', options) && !hasIn('cause', this)) {
19
+ if (options != null && typeof options === 'object' && Object.hasOwn(options, 'cause') && !('cause' in this)) {
22
20
  const {
23
21
  cause
24
22
  } = options;
25
23
  this.cause = cause;
26
- if (cause instanceof Error && hasIn('stack', cause)) {
27
- this.stack = `${this.stack}\nCAUSE: ${cause === null || cause === void 0 ? void 0 : cause.stack}`;
24
+ if (cause instanceof Error && 'stack' in cause) {
25
+ this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
28
26
  }
29
27
  }
30
28
  }
@@ -1,5 +1,3 @@
1
- import { hasIn } from 'ramda';
2
- import { isPlainObject } from 'ramda-adjunct';
3
1
  import ApiDOMAggregateError from "./ApiDOMAggregateError.mjs";
4
2
  class ApiDOMError extends Error {
5
3
  static [Symbol.hasInstance](instance) {
@@ -22,13 +20,13 @@ class ApiDOMError extends Error {
22
20
  * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
23
21
  * Node.js is >= 16.9.0 supports error causes natively.
24
22
  */
25
- if (isPlainObject(options) && hasIn('cause', options) && !hasIn('cause', this)) {
23
+ if (options != null && typeof options === 'object' && Object.hasOwn(options, 'cause') && !('cause' in this)) {
26
24
  const {
27
25
  cause
28
26
  } = options;
29
27
  this.cause = cause;
30
- if (cause instanceof Error && hasIn('stack', cause)) {
31
- this.stack = `${this.stack}\nCAUSE: ${cause === null || cause === void 0 ? void 0 : cause.stack}`;
28
+ if (cause instanceof Error && 'stack' in cause) {
29
+ this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
32
30
  }
33
31
  }
34
32
  }
@@ -1,10 +1,13 @@
1
- import { omit } from 'ramda';
2
1
  import ApiDOMError from "./ApiDOMError.mjs";
3
2
  class ApiDOMStructuredError extends ApiDOMError {
4
3
  constructor(message, structuredOptions) {
5
4
  super(message, structuredOptions);
6
- if (typeof structuredOptions !== 'undefined') {
7
- Object.assign(this, omit(['cause'], structuredOptions));
5
+ if (structuredOptions != null && typeof structuredOptions === 'object') {
6
+ const {
7
+ cause,
8
+ ...causelessOptions
9
+ } = structuredOptions;
10
+ Object.assign(this, causelessOptions);
8
11
  }
9
12
  }
10
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swagger-api/apidom-error",
3
- "version": "0.81.0",
3
+ "version": "0.82.1",
4
4
  "description": "Backward compatible custom ApiDOM errors with causes.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -37,10 +37,7 @@
37
37
  "author": "Vladimír Gorej",
38
38
  "license": "Apache-2.0",
39
39
  "dependencies": {
40
- "@babel/runtime-corejs3": "^7.20.7",
41
- "@types/ramda": "~0.29.6",
42
- "ramda": "~0.29.0",
43
- "ramda-adjunct": "^4.0.0"
40
+ "@babel/runtime-corejs3": "^7.20.7"
44
41
  },
45
42
  "files": [
46
43
  "cjs/",
@@ -52,5 +49,5 @@
52
49
  "README.md",
53
50
  "CHANGELOG.md"
54
51
  ],
55
- "gitHead": "06960c4ddf3aaaaf394b4ffcb4e42201f9bcbad6"
52
+ "gitHead": "94999a0e9d60437edf7a922f8a844753fcb51469"
56
53
  }