ast-compare 4.0.5 → 4.0.7

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,11 +1,11 @@
1
1
  /**
2
2
  * @name ast-compare
3
3
  * @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
4
- * @version 4.0.5
4
+ * @version 4.0.7
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-compare/}
8
8
  */
9
9
 
10
- import i from"type-detect";import{empty as s}from"ast-contains-only-empty-space";import{isPlainObject as o}from"codsen-utils";import{isMatch as m}from"matcher";var f="4.0.5";var W=f;function O(e){return o(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var j={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function d(e,t,b){let c,u,h,g=0,r={...j,...b};if(r.hungryForWhitespace&&r.matchStrictly&&o(e)&&s(e)&&o(t)&&!Object.keys(t).length)return!0;if((!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)&&s(t))&&o(e)&&Object.keys(e).length!==0&&o(t)&&Object.keys(t).length===0||i(e)!==i(t)&&(!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)))return!1;if(typeof e=="string"&&typeof t=="string")return r.hungryForWhitespace&&s(e)&&s(t)?!0:r.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:r.useWildcards?m(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(r.hungryForWhitespace&&s(t)&&(!r.matchStrictly||r.matchStrictly&&e.length===t.length))return!0;if(!r.hungryForWhitespace&&t.length>e.length||r.matchStrictly&&t.length!==e.length)return r.verboseWhenMismatches?`The length of a given array, ${JSON.stringify(t,null,4)} is ${t.length} but the length of an array on the other end, ${JSON.stringify(e,null,4)} is ${e.length}`:!1;if(t.length===0)return e.length===0?!0:r.verboseWhenMismatches?`The given array has no elements, but the array on the other end, ${JSON.stringify(e,null,4)} does have some`:!1;for(let n=0,a=t.length;n<a;n++){h=!1;for(let l=g,y=e.length;l<y;l++)if(g+=1,d(e[l],t[n],r)===!0){h=!0;break}if(!h)return r.verboseWhenMismatches?`The given array ${JSON.stringify(t,null,4)} is not a subset of an array on the other end, ${JSON.stringify(e,null,4)}`:!1}}else if(o(e)&&o(t)){if(c=new Set(Object.keys(t)),u=new Set(Object.keys(e)),r.matchStrictly&&c.size!==u.size){if(!r.verboseWhenMismatches)return!1;let n=new Set([...c].filter(p=>!u.has(p))),a=n.size?` First object has unique keys: ${JSON.stringify(n,null,4)}.`:"",l=new Set([...u].filter(p=>!c.has(p))),y=l.size?` Second object has unique keys:
10
+ import i from"type-detect";import{empty as s}from"ast-contains-only-empty-space";import{isPlainObject as o}from"codsen-utils";import{isMatch as m}from"matcher";var f="4.0.7";var W=f;function O(e){return o(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var j={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function d(e,t,b){let c,u,h,g=0,r={...j,...b};if(r.hungryForWhitespace&&r.matchStrictly&&o(e)&&s(e)&&o(t)&&!Object.keys(t).length)return!0;if((!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)&&s(t))&&o(e)&&Object.keys(e).length!==0&&o(t)&&Object.keys(t).length===0||i(e)!==i(t)&&(!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)))return!1;if(typeof e=="string"&&typeof t=="string")return r.hungryForWhitespace&&s(e)&&s(t)?!0:r.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:r.useWildcards?m(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(r.hungryForWhitespace&&s(t)&&(!r.matchStrictly||r.matchStrictly&&e.length===t.length))return!0;if(!r.hungryForWhitespace&&t.length>e.length||r.matchStrictly&&t.length!==e.length)return r.verboseWhenMismatches?`The length of a given array, ${JSON.stringify(t,null,4)} is ${t.length} but the length of an array on the other end, ${JSON.stringify(e,null,4)} is ${e.length}`:!1;if(t.length===0)return e.length===0?!0:r.verboseWhenMismatches?`The given array has no elements, but the array on the other end, ${JSON.stringify(e,null,4)} does have some`:!1;for(let n=0,a=t.length;n<a;n++){h=!1;for(let l=g,y=e.length;l<y;l++)if(g+=1,d(e[l],t[n],r)===!0){h=!0;break}if(!h)return r.verboseWhenMismatches?`The given array ${JSON.stringify(t,null,4)} is not a subset of an array on the other end, ${JSON.stringify(e,null,4)}`:!1}}else if(o(e)&&o(t)){if(c=new Set(Object.keys(t)),u=new Set(Object.keys(e)),r.matchStrictly&&c.size!==u.size){if(!r.verboseWhenMismatches)return!1;let n=new Set([...c].filter(p=>!u.has(p))),a=n.size?` First object has unique keys: ${JSON.stringify(n,null,4)}.`:"",l=new Set([...u].filter(p=>!c.has(p))),y=l.size?` Second object has unique keys:
11
11
  ${JSON.stringify(l,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${a}${y}`}for(let n of c){if(!Object.prototype.hasOwnProperty.call(e,n))return!r.useWildcards||r.useWildcards&&!n.includes("*")?r.verboseWhenMismatches?`The given object has key "${n}" which the other-one does not have.`:!1:Object.keys(e).some(a=>m(a,n,{caseSensitive:!0}))?!0:r.verboseWhenMismatches?`The given object has key "${n}" which the other-one does not have.`:!1;if(e[n]!=null&&i(e[n])!==i(t[n])){if(!(s(e[n])&&s(t[n])&&r.hungryForWhitespace))return r.verboseWhenMismatches?`The given key ${n} is of a different type on both objects. On the first-one, it's ${i(t[n])}, on the second-one, it's ${i(e[n])}`:!1}else if(d(e[n],t[n],r)!==!0)return r.verboseWhenMismatches?`The given piece ${JSON.stringify(t[n],null,4)} and ${JSON.stringify(e[n],null,4)} don't match.`:!1}}else return r.hungryForWhitespace&&s(e)&&s(t)&&(!r.matchStrictly||r.matchStrictly&&O(t))?!0:e===t;return!0}export{d as compare,j as defaults,W as version};
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * @name ast-compare
3
3
  * @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
4
- * @version 4.0.5
4
+ * @version 4.0.7
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-compare/}
8
8
  */
9
9
 
10
- "use strict";var astCompare=(()=>{var Ot=Object.create;var V=Object.defineProperty,St=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Et=Object.getOwnPropertyDescriptors,xt=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,_t=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable;var me=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))be.call(t,r)&&me(e,r,t[r]);if(de)for(var r of de(t))jt.call(t,r)&&me(e,r,t[r]);return e},M=(e,t)=>St(e,Et(t));var ve=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$t=(e,t)=>{for(var r in t)V(e,r,{get:t[r],enumerable:!0})},Oe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of xt(t))!be.call(e,a)&&a!==r&&V(e,a,{get:()=>t[a],enumerable:!(n=wt(t,a))||n.enumerable});return e};var Se=(e,t,r)=>(r=e!=null?Ot(_t(e)):{},Oe(t||!e||!e.__esModule?V(r,"default",{value:e,enumerable:!0}):r,e)),At=e=>Oe(V({},"__esModule",{value:!0}),e);var we=ve((B,G)=>{(function(e,t){typeof B=="object"&&typeof G<"u"?G.exports=t():typeof define=="function"&&define.amd?define(t):e.typeDetect=t()})(B,function(){"use strict";var e=typeof Promise=="function",t=typeof self=="object"?self:global,r=typeof Symbol<"u",n=typeof Map<"u",a=typeof Set<"u",c=typeof WeakMap<"u",u=typeof WeakSet<"u",o=typeof DataView<"u",s=r&&typeof Symbol.iterator<"u",f=r&&typeof Symbol.toStringTag<"u",i=a&&typeof Set.prototype.entries=="function",l=n&&typeof Map.prototype.entries=="function",g=i&&Object.getPrototypeOf(new Set().entries()),v=l&&Object.getPrototypeOf(new Map().entries()),E=s&&typeof Array.prototype[Symbol.iterator]=="function",ht=E&&Object.getPrototypeOf([][Symbol.iterator]()),ye=s&&typeof String.prototype[Symbol.iterator]=="function",dt=ye&&Object.getPrototypeOf(""[Symbol.iterator]()),mt=8,bt=-1;function vt(y){var ge=typeof y;if(ge!=="object")return ge;if(y===null)return"null";if(y===t)return"global";if(Array.isArray(y)&&(f===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var he=f&&y[Symbol.toStringTag];if(typeof he=="string")return he;var h=Object.getPrototypeOf(y);return h===RegExp.prototype?"RegExp":h===Date.prototype?"Date":e&&h===Promise.prototype?"Promise":a&&h===Set.prototype?"Set":n&&h===Map.prototype?"Map":u&&h===WeakSet.prototype?"WeakSet":c&&h===WeakMap.prototype?"WeakMap":o&&h===DataView.prototype?"DataView":n&&h===v?"Map Iterator":a&&h===g?"Set Iterator":E&&h===ht?"Array Iterator":ye&&h===dt?"String Iterator":h===null?"Object":Object.prototype.toString.call(y).slice(mt,bt)}return vt})});var ut=ve((P,A)=>{var Tt=200,Pe="__lodash_hash_undefined__",We=9007199254740991,te="[object Arguments]",Dt="[object Array]",Ie="[object Boolean]",ke="[object Date]",Ct="[object Error]",re="[object Function]",Le="[object GeneratorFunction]",k="[object Map]",Ne="[object Number]",ne="[object Object]",Ee="[object Promise]",Fe="[object RegExp]",L="[object Set]",Je="[object String]",Ke="[object Symbol]",q="[object WeakMap]",Re="[object ArrayBuffer]",N="[object DataView]",He="[object Float32Array]",Ue="[object Float64Array]",Be="[object Int8Array]",Ge="[object Int16Array]",Qe="[object Int32Array]",qe="[object Uint8Array]",ze="[object Uint8ClampedArray]",Xe="[object Uint16Array]",Ye="[object Uint32Array]",Vt=/[\\^$.*+?()[\]{}|]/g,Mt=/\w*$/,Pt=/^\[object .+?Constructor\]$/,Wt=/^(?:0|[1-9]\d*)$/,p={};p[te]=p[Dt]=p[Re]=p[N]=p[Ie]=p[ke]=p[He]=p[Ue]=p[Be]=p[Ge]=p[Qe]=p[k]=p[Ne]=p[ne]=p[Fe]=p[L]=p[Je]=p[Ke]=p[qe]=p[ze]=p[Xe]=p[Ye]=!0;p[Ct]=p[re]=p[q]=!1;var It=typeof global=="object"&&global&&global.Object===Object&&global,kt=typeof self=="object"&&self&&self.Object===Object&&self,O=It||kt||Function("return this")(),Ze=typeof P=="object"&&P&&!P.nodeType&&P,xe=Ze&&typeof A=="object"&&A&&!A.nodeType&&A,Lt=xe&&xe.exports===Ze;function Nt(e,t){return e.set(t[0],t[1]),e}function Ft(e,t){return e.add(t),e}function Jt(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Kt(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function et(e,t,r,n){var a=-1,c=e?e.length:0;for(n&&c&&(r=e[++a]);++a<c;)r=t(r,e[a],a,e);return r}function Rt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ht(e,t){return e==null?void 0:e[t]}function tt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function _e(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function oe(e,t){return function(r){return e(t(r))}}function je(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Ut=Array.prototype,Bt=Function.prototype,F=Object.prototype,Q=O["__core-js_shared__"],$e=function(){var e=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),rt=Bt.toString,w=F.hasOwnProperty,J=F.toString,Gt=RegExp("^"+rt.call(w).replace(Vt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=Lt?O.Buffer:void 0,Te=O.Symbol,De=O.Uint8Array,Qt=oe(Object.getPrototypeOf,Object),qt=Object.create,zt=F.propertyIsEnumerable,Xt=Ut.splice,Ce=Object.getOwnPropertySymbols,Yt=Ae?Ae.isBuffer:void 0,Zt=oe(Object.keys,Object),z=C(O,"DataView"),W=C(O,"Map"),X=C(O,"Promise"),Y=C(O,"Set"),Z=C(O,"WeakMap"),I=C(Object,"create"),er=j(z),tr=j(W),rr=j(X),nr=j(Y),or=j(Z),Ve=Te?Te.prototype:void 0,Me=Ve?Ve.valueOf:void 0;function _(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function sr(){this.__data__=I?I(null):{}}function ar(e){return this.has(e)&&delete this.__data__[e]}function ir(e){var t=this.__data__;if(I){var r=t[e];return r===Pe?void 0:r}return w.call(t,e)?t[e]:void 0}function cr(e){var t=this.__data__;return I?t[e]!==void 0:w.call(t,e)}function lr(e,t){var r=this.__data__;return r[e]=I&&t===void 0?Pe:t,this}_.prototype.clear=sr;_.prototype.delete=ar;_.prototype.get=ir;_.prototype.has=cr;_.prototype.set=lr;function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ur(){this.__data__=[]}function fr(e){var t=this.__data__,r=K(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Xt.call(t,r,1),!0}function pr(e){var t=this.__data__,r=K(t,e);return r<0?void 0:t[r][1]}function yr(e){return K(this.__data__,e)>-1}function gr(e,t){var r=this.__data__,n=K(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}S.prototype.clear=ur;S.prototype.delete=fr;S.prototype.get=pr;S.prototype.has=yr;S.prototype.set=gr;function T(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hr(){this.__data__={hash:new _,map:new(W||S),string:new _}}function dr(e){return R(this,e).delete(e)}function mr(e){return R(this,e).get(e)}function br(e){return R(this,e).has(e)}function vr(e,t){return R(this,e).set(e,t),this}T.prototype.clear=hr;T.prototype.delete=dr;T.prototype.get=mr;T.prototype.has=br;T.prototype.set=vr;function D(e){this.__data__=new S(e)}function Or(){this.__data__=new S}function Sr(e){return this.__data__.delete(e)}function wr(e){return this.__data__.get(e)}function Er(e){return this.__data__.has(e)}function xr(e,t){var r=this.__data__;if(r instanceof S){var n=r.__data__;if(!W||n.length<Tt-1)return n.push([e,t]),this;r=this.__data__=new T(n)}return r.set(e,t),this}D.prototype.clear=Or;D.prototype.delete=Sr;D.prototype.get=wr;D.prototype.has=Er;D.prototype.set=xr;function _r(e,t){var r=ae(e)||qr(e)?Rt(e.length,String):[],n=r.length,a=!!n;for(var c in e)(t||w.call(e,c))&&!(a&&(c=="length"||Ur(c,n)))&&r.push(c);return r}function nt(e,t,r){var n=e[t];(!(w.call(e,t)&&it(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function K(e,t){for(var r=e.length;r--;)if(it(e[r][0],t))return r;return-1}function jr(e,t){return e&&ot(t,ie(t),e)}function ee(e,t,r,n,a,c,u){var o;if(n&&(o=c?n(e,a,c,u):n(e)),o!==void 0)return o;if(!H(e))return e;var s=ae(e);if(s){if(o=Kr(e),!t)return Nr(e,o)}else{var f=x(e),i=f==re||f==Le;if(Xr(e))return Vr(e,t);if(f==ne||f==te||i&&!c){if(tt(e))return c?e:{};if(o=Rr(i?{}:e),!t)return Fr(e,jr(o,e))}else{if(!p[f])return c?e:{};o=Hr(e,f,ee,t)}}u||(u=new D);var l=u.get(e);if(l)return l;if(u.set(e,o),!s)var g=r?Jr(e):ie(e);return Jt(g||e,function(v,E){g&&(E=v,v=e[E]),nt(o,E,ee(v,t,r,n,E,e,u))}),o}function $r(e){return H(e)?qt(e):{}}function Ar(e,t,r){var n=t(e);return ae(e)?n:Kt(n,r(e))}function Tr(e){return J.call(e)}function Dr(e){if(!H(e)||Gr(e))return!1;var t=lt(e)||tt(e)?Gt:Pt;return t.test(j(e))}function Cr(e){if(!at(e))return Zt(e);var t=[];for(var r in Object(e))w.call(e,r)&&r!="constructor"&&t.push(r);return t}function Vr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function se(e){var t=new e.constructor(e.byteLength);return new De(t).set(new De(e)),t}function Mr(e,t){var r=t?se(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Pr(e,t,r){var n=t?r(_e(e),!0):_e(e);return et(n,Nt,new e.constructor)}function Wr(e){var t=new e.constructor(e.source,Mt.exec(e));return t.lastIndex=e.lastIndex,t}function Ir(e,t,r){var n=t?r(je(e),!0):je(e);return et(n,Ft,new e.constructor)}function kr(e){return Me?Object(Me.call(e)):{}}function Lr(e,t){var r=t?se(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Nr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function ot(e,t,r,n){r||(r={});for(var a=-1,c=t.length;++a<c;){var u=t[a],o=n?n(r[u],e[u],u,r,e):void 0;nt(r,u,o===void 0?e[u]:o)}return r}function Fr(e,t){return ot(e,st(e),t)}function Jr(e){return Ar(e,ie,st)}function R(e,t){var r=e.__data__;return Br(t)?r[typeof t=="string"?"string":"hash"]:r.map}function C(e,t){var r=Ht(e,t);return Dr(r)?r:void 0}var st=Ce?oe(Ce,Object):en,x=Tr;(z&&x(new z(new ArrayBuffer(1)))!=N||W&&x(new W)!=k||X&&x(X.resolve())!=Ee||Y&&x(new Y)!=L||Z&&x(new Z)!=q)&&(x=function(e){var t=J.call(e),r=t==ne?e.constructor:void 0,n=r?j(r):void 0;if(n)switch(n){case er:return N;case tr:return k;case rr:return Ee;case nr:return L;case or:return q}return t});function Kr(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&w.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Rr(e){return typeof e.constructor=="function"&&!at(e)?$r(Qt(e)):{}}function Hr(e,t,r,n){var a=e.constructor;switch(t){case Re:return se(e);case Ie:case ke:return new a(+e);case N:return Mr(e,n);case He:case Ue:case Be:case Ge:case Qe:case qe:case ze:case Xe:case Ye:return Lr(e,n);case k:return Pr(e,n,r);case Ne:case Je:return new a(e);case Fe:return Wr(e);case L:return Ir(e,n,r);case Ke:return kr(e)}}function Ur(e,t){return t=t==null?We:t,!!t&&(typeof e=="number"||Wt.test(e))&&e>-1&&e%1==0&&e<t}function Br(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Gr(e){return!!$e&&$e in e}function at(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||F;return e===r}function j(e){if(e!=null){try{return rt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Qr(e){return ee(e,!0,!0)}function it(e,t){return e===t||e!==e&&t!==t}function qr(e){return zr(e)&&w.call(e,"callee")&&(!zt.call(e,"callee")||J.call(e)==te)}var ae=Array.isArray;function ct(e){return e!=null&&Yr(e.length)&&!lt(e)}function zr(e){return Zr(e)&&ct(e)}var Xr=Yt||tn;function lt(e){var t=H(e)?J.call(e):"";return t==re||t==Le}function Yr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=We}function H(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Zr(e){return!!e&&typeof e=="object"}function ie(e){return ct(e)?_r(e):Cr(e)}function en(){return[]}function tn(){return!1}A.exports=Qr});var ln={};$t(ln,{compare:()=>pe,defaults:()=>gt,version:()=>an});var $=Se(we(),1);var U=Se(ut(),1);function b(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function rn(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let r=t-1;r--;)if(e[r]===".")return e.slice(r+1,t)}return null}var ce=rn;function ft(e,t){let r={now:!1};function n(a,c,u,o){let s=(0,U.default)(a),f,i=m({depth:-1,path:""},u);if(i.depth+=1,Array.isArray(s))for(let l=0,g=s.length;l<g&&!o.now;l++){let v=i.path?`${i.path}.${l}`:`${l}`;s[l]!==void 0?(i.parent=(0,U.default)(s),i.parentType="array",i.parentKey=ce(v),f=n(c(s[l],void 0,M(m({},i),{path:v}),o),c,M(m({},i),{path:v}),o),Number.isNaN(f)&&l<s.length?(s.splice(l,1),l-=1):s[l]=f):s.splice(l,1)}else if(b(s))for(let l in s){if(o.now&&l!=null)break;let g=i.path?`${i.path}.${l}`:l;i.depth===0&&l!=null&&(i.topmostKey=l),i.parent=(0,U.default)(s),i.parentType="object",i.parentKey=ce(g),f=n(c(l,s[l],M(m({},i),{path:g}),o),c,M(m({},i),{path:g}),o),Number.isNaN(f)?delete s[l]:s[l]=f}return s}return n(e,t,{},r)}function d(e){if(typeof e=="string")return!e.trim();if(!["object","string"].includes(typeof e)||!e)return!1;let t=!0;return e=ft(e,(r,n,a,c)=>{let u=n!==void 0?n:r;return typeof u=="string"&&u.trim()&&(t=!1,c.now=!0),u}),t}function le(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ue=new Map,pt=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},nn=(e,t)=>{t=m({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(ue.has(r))return ue.get(r);let n=e[0]==="!";n&&(e=e.slice(1)),e=le(e).replace(/\\\*/g,"[\\s\\S]*");let a=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return a.negated=n,ue.set(r,a),a},on=(e,t,r,n)=>{if(e=pt(e,"inputs"),t=pt(t,"patterns"),t.length===0)return[];t=t.map(u=>nn(u,r));let{allPatterns:a}=r||{},c=[];for(let u of e){let o,s=[...t].fill(!1);for(let[f,i]of t.entries())if(i.test(u)&&(s[f]=!0,o=!i.negated,!o))break;if(!(o===!1||o===void 0&&t.some(f=>!f.negated)||a&&s.some((f,i)=>!f&&!t[i].negated))&&(c.push(u),n))break}return c};function fe(e,t,r){return on(e,t,r,!0).length>0}var yt="4.0.5";var an=yt;function cn(e){return b(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var gt={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function pe(e,t,r){let n,a,c,u=0,o=m(m({},gt),r);if(o.hungryForWhitespace&&o.matchStrictly&&b(e)&&d(e)&&b(t)&&!Object.keys(t).length)return!0;if((!o.hungryForWhitespace||o.hungryForWhitespace&&!d(e)&&d(t))&&b(e)&&Object.keys(e).length!==0&&b(t)&&Object.keys(t).length===0||(0,$.default)(e)!==(0,$.default)(t)&&(!o.hungryForWhitespace||o.hungryForWhitespace&&!d(e)))return!1;if(typeof e=="string"&&typeof t=="string")return o.hungryForWhitespace&&d(e)&&d(t)?!0:o.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:o.useWildcards?fe(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(o.hungryForWhitespace&&d(t)&&(!o.matchStrictly||o.matchStrictly&&e.length===t.length))return!0;if(!o.hungryForWhitespace&&t.length>e.length||o.matchStrictly&&t.length!==e.length)return o.verboseWhenMismatches?`The length of a given array, ${JSON.stringify(t,null,4)} is ${t.length} but the length of an array on the other end, ${JSON.stringify(e,null,4)} is ${e.length}`:!1;if(t.length===0)return e.length===0?!0:o.verboseWhenMismatches?`The given array has no elements, but the array on the other end, ${JSON.stringify(e,null,4)} does have some`:!1;for(let s=0,f=t.length;s<f;s++){c=!1;for(let i=u,l=e.length;i<l;i++)if(u+=1,pe(e[i],t[s],o)===!0){c=!0;break}if(!c)return o.verboseWhenMismatches?`The given array ${JSON.stringify(t,null,4)} is not a subset of an array on the other end, ${JSON.stringify(e,null,4)}`:!1}}else if(b(e)&&b(t)){if(n=new Set(Object.keys(t)),a=new Set(Object.keys(e)),o.matchStrictly&&n.size!==a.size){if(!o.verboseWhenMismatches)return!1;let s=new Set([...n].filter(g=>!a.has(g))),f=s.size?` First object has unique keys: ${JSON.stringify(s,null,4)}.`:"",i=new Set([...a].filter(g=>!n.has(g))),l=i.size?` Second object has unique keys:
11
- ${JSON.stringify(i,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${f}${l}`}for(let s of n){if(!Object.prototype.hasOwnProperty.call(e,s))return!o.useWildcards||o.useWildcards&&!s.includes("*")?o.verboseWhenMismatches?`The given object has key "${s}" which the other-one does not have.`:!1:Object.keys(e).some(f=>fe(f,s,{caseSensitive:!0}))?!0:o.verboseWhenMismatches?`The given object has key "${s}" which the other-one does not have.`:!1;if(e[s]!=null&&(0,$.default)(e[s])!==(0,$.default)(t[s])){if(!(d(e[s])&&d(t[s])&&o.hungryForWhitespace))return o.verboseWhenMismatches?`The given key ${s} is of a different type on both objects. On the first-one, it's ${(0,$.default)(t[s])}, on the second-one, it's ${(0,$.default)(e[s])}`:!1}else if(pe(e[s],t[s],o)!==!0)return o.verboseWhenMismatches?`The given piece ${JSON.stringify(t[s],null,4)} and ${JSON.stringify(e[s],null,4)} don't match.`:!1}}else return o.hungryForWhitespace&&d(e)&&d(t)&&(!o.matchStrictly||o.matchStrictly&&cn(t))?!0:e===t;return!0}return At(ln);})();
10
+ "use strict";var astCompare=(()=>{var Ot=Object.create;var V=Object.defineProperty,St=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,At=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,xt=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var me=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))be.call(t,r)&&me(e,r,t[r]);if(de)for(var r of de(t))Et.call(t,r)&&me(e,r,t[r]);return e},M=(e,t)=>St(e,At(t));var ve=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_t=(e,t)=>{for(var r in t)V(e,r,{get:t[r],enumerable:!0})},Oe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of $t(t))!be.call(e,a)&&a!==r&&V(e,a,{get:()=>t[a],enumerable:!(n=wt(t,a))||n.enumerable});return e};var Se=(e,t,r)=>(r=e!=null?Ot(xt(e)):{},Oe(t||!e||!e.__esModule?V(r,"default",{value:e,enumerable:!0}):r,e)),jt=e=>Oe(V({},"__esModule",{value:!0}),e);var we=ve((U,G)=>{(function(e,t){typeof U=="object"&&typeof G<"u"?G.exports=t():typeof define=="function"&&define.amd?define(t):e.typeDetect=t()})(U,function(){"use strict";var e=typeof Promise=="function",t=typeof self=="object"?self:global,r=typeof Symbol<"u",n=typeof Map<"u",a=typeof Set<"u",u=typeof WeakMap<"u",l=typeof WeakSet<"u",o=typeof DataView<"u",s=r&&typeof Symbol.iterator<"u",f=r&&typeof Symbol.toStringTag<"u",i=a&&typeof Set.prototype.entries=="function",c=n&&typeof Map.prototype.entries=="function",g=i&&Object.getPrototypeOf(new Set().entries()),v=c&&Object.getPrototypeOf(new Map().entries()),A=s&&typeof Array.prototype[Symbol.iterator]=="function",ht=A&&Object.getPrototypeOf([][Symbol.iterator]()),ye=s&&typeof String.prototype[Symbol.iterator]=="function",dt=ye&&Object.getPrototypeOf(""[Symbol.iterator]()),mt=8,bt=-1;function vt(y){var ge=typeof y;if(ge!=="object")return ge;if(y===null)return"null";if(y===t)return"global";if(Array.isArray(y)&&(f===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var he=f&&y[Symbol.toStringTag];if(typeof he=="string")return he;var h=Object.getPrototypeOf(y);return h===RegExp.prototype?"RegExp":h===Date.prototype?"Date":e&&h===Promise.prototype?"Promise":a&&h===Set.prototype?"Set":n&&h===Map.prototype?"Map":l&&h===WeakSet.prototype?"WeakSet":u&&h===WeakMap.prototype?"WeakMap":o&&h===DataView.prototype?"DataView":n&&h===v?"Map Iterator":a&&h===g?"Set Iterator":A&&h===ht?"Array Iterator":ye&&h===dt?"String Iterator":h===null?"Object":Object.prototype.toString.call(y).slice(mt,bt)}return vt})});var lt=ve((P,j)=>{var Dt=200,Pe="__lodash_hash_undefined__",We=9007199254740991,te="[object Arguments]",Tt="[object Array]",ke="[object Boolean]",Ie="[object Date]",Ct="[object Error]",re="[object Function]",Le="[object GeneratorFunction]",I="[object Map]",Ne="[object Number]",ne="[object Object]",Ae="[object Promise]",Fe="[object RegExp]",L="[object Set]",Be="[object String]",Re="[object Symbol]",q="[object WeakMap]",Je="[object ArrayBuffer]",N="[object DataView]",Ke="[object Float32Array]",He="[object Float64Array]",Ue="[object Int8Array]",Ge="[object Int16Array]",Qe="[object Int32Array]",qe="[object Uint8Array]",ze="[object Uint8ClampedArray]",Ze="[object Uint16Array]",Xe="[object Uint32Array]",Vt=/[\\^$.*+?()[\]{}|]/g,Mt=/\w*$/,Pt=/^\[object .+?Constructor\]$/,Wt=/^(?:0|[1-9]\d*)$/,p={};p[te]=p[Tt]=p[Je]=p[N]=p[ke]=p[Ie]=p[Ke]=p[He]=p[Ue]=p[Ge]=p[Qe]=p[I]=p[Ne]=p[ne]=p[Fe]=p[L]=p[Be]=p[Re]=p[qe]=p[ze]=p[Ze]=p[Xe]=!0;p[Ct]=p[re]=p[q]=!1;var kt=typeof global=="object"&&global&&global.Object===Object&&global,It=typeof self=="object"&&self&&self.Object===Object&&self,O=kt||It||Function("return this")(),Ye=typeof P=="object"&&P&&!P.nodeType&&P,$e=Ye&&typeof j=="object"&&j&&!j.nodeType&&j,Lt=$e&&$e.exports===Ye;function Nt(e,t){return e.set(t[0],t[1]),e}function Ft(e,t){return e.add(t),e}function Bt(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Rt(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function et(e,t,r,n){var a=-1,u=e?e.length:0;for(n&&u&&(r=e[++a]);++a<u;)r=t(r,e[a],a,e);return r}function Jt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Kt(e,t){return e==null?void 0:e[t]}function tt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function xe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function oe(e,t){return function(r){return e(t(r))}}function Ee(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Ht=Array.prototype,Ut=Function.prototype,F=Object.prototype,Q=O["__core-js_shared__"],_e=function(){var e=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),rt=Ut.toString,w=F.hasOwnProperty,B=F.toString,Gt=RegExp("^"+rt.call(w).replace(Vt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=Lt?O.Buffer:void 0,De=O.Symbol,Te=O.Uint8Array,Qt=oe(Object.getPrototypeOf,Object),qt=Object.create,zt=F.propertyIsEnumerable,Zt=Ht.splice,Ce=Object.getOwnPropertySymbols,Xt=je?je.isBuffer:void 0,Yt=oe(Object.keys,Object),z=C(O,"DataView"),W=C(O,"Map"),Z=C(O,"Promise"),X=C(O,"Set"),Y=C(O,"WeakMap"),k=C(Object,"create"),er=E(z),tr=E(W),rr=E(Z),nr=E(X),or=E(Y),Ve=De?De.prototype:void 0,Me=Ve?Ve.valueOf:void 0;function x(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function sr(){this.__data__=k?k(null):{}}function ar(e){return this.has(e)&&delete this.__data__[e]}function ir(e){var t=this.__data__;if(k){var r=t[e];return r===Pe?void 0:r}return w.call(t,e)?t[e]:void 0}function ur(e){var t=this.__data__;return k?t[e]!==void 0:w.call(t,e)}function cr(e,t){var r=this.__data__;return r[e]=k&&t===void 0?Pe:t,this}x.prototype.clear=sr;x.prototype.delete=ar;x.prototype.get=ir;x.prototype.has=ur;x.prototype.set=cr;function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function lr(){this.__data__=[]}function fr(e){var t=this.__data__,r=R(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Zt.call(t,r,1),!0}function pr(e){var t=this.__data__,r=R(t,e);return r<0?void 0:t[r][1]}function yr(e){return R(this.__data__,e)>-1}function gr(e,t){var r=this.__data__,n=R(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}S.prototype.clear=lr;S.prototype.delete=fr;S.prototype.get=pr;S.prototype.has=yr;S.prototype.set=gr;function D(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hr(){this.__data__={hash:new x,map:new(W||S),string:new x}}function dr(e){return J(this,e).delete(e)}function mr(e){return J(this,e).get(e)}function br(e){return J(this,e).has(e)}function vr(e,t){return J(this,e).set(e,t),this}D.prototype.clear=hr;D.prototype.delete=dr;D.prototype.get=mr;D.prototype.has=br;D.prototype.set=vr;function T(e){this.__data__=new S(e)}function Or(){this.__data__=new S}function Sr(e){return this.__data__.delete(e)}function wr(e){return this.__data__.get(e)}function Ar(e){return this.__data__.has(e)}function $r(e,t){var r=this.__data__;if(r instanceof S){var n=r.__data__;if(!W||n.length<Dt-1)return n.push([e,t]),this;r=this.__data__=new D(n)}return r.set(e,t),this}T.prototype.clear=Or;T.prototype.delete=Sr;T.prototype.get=wr;T.prototype.has=Ar;T.prototype.set=$r;function xr(e,t){var r=ae(e)||qr(e)?Jt(e.length,String):[],n=r.length,a=!!n;for(var u in e)(t||w.call(e,u))&&!(a&&(u=="length"||Hr(u,n)))&&r.push(u);return r}function nt(e,t,r){var n=e[t];(!(w.call(e,t)&&it(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function R(e,t){for(var r=e.length;r--;)if(it(e[r][0],t))return r;return-1}function Er(e,t){return e&&ot(t,ie(t),e)}function ee(e,t,r,n,a,u,l){var o;if(n&&(o=u?n(e,a,u,l):n(e)),o!==void 0)return o;if(!K(e))return e;var s=ae(e);if(s){if(o=Rr(e),!t)return Nr(e,o)}else{var f=$(e),i=f==re||f==Le;if(Zr(e))return Vr(e,t);if(f==ne||f==te||i&&!u){if(tt(e))return u?e:{};if(o=Jr(i?{}:e),!t)return Fr(e,Er(o,e))}else{if(!p[f])return u?e:{};o=Kr(e,f,ee,t)}}l||(l=new T);var c=l.get(e);if(c)return c;if(l.set(e,o),!s)var g=r?Br(e):ie(e);return Bt(g||e,function(v,A){g&&(A=v,v=e[A]),nt(o,A,ee(v,t,r,n,A,e,l))}),o}function _r(e){return K(e)?qt(e):{}}function jr(e,t,r){var n=t(e);return ae(e)?n:Rt(n,r(e))}function Dr(e){return B.call(e)}function Tr(e){if(!K(e)||Gr(e))return!1;var t=ct(e)||tt(e)?Gt:Pt;return t.test(E(e))}function Cr(e){if(!at(e))return Yt(e);var t=[];for(var r in Object(e))w.call(e,r)&&r!="constructor"&&t.push(r);return t}function Vr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function se(e){var t=new e.constructor(e.byteLength);return new Te(t).set(new Te(e)),t}function Mr(e,t){var r=t?se(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Pr(e,t,r){var n=t?r(xe(e),!0):xe(e);return et(n,Nt,new e.constructor)}function Wr(e){var t=new e.constructor(e.source,Mt.exec(e));return t.lastIndex=e.lastIndex,t}function kr(e,t,r){var n=t?r(Ee(e),!0):Ee(e);return et(n,Ft,new e.constructor)}function Ir(e){return Me?Object(Me.call(e)):{}}function Lr(e,t){var r=t?se(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Nr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function ot(e,t,r,n){r||(r={});for(var a=-1,u=t.length;++a<u;){var l=t[a],o=n?n(r[l],e[l],l,r,e):void 0;nt(r,l,o===void 0?e[l]:o)}return r}function Fr(e,t){return ot(e,st(e),t)}function Br(e){return jr(e,ie,st)}function J(e,t){var r=e.__data__;return Ur(t)?r[typeof t=="string"?"string":"hash"]:r.map}function C(e,t){var r=Kt(e,t);return Tr(r)?r:void 0}var st=Ce?oe(Ce,Object):en,$=Dr;(z&&$(new z(new ArrayBuffer(1)))!=N||W&&$(new W)!=I||Z&&$(Z.resolve())!=Ae||X&&$(new X)!=L||Y&&$(new Y)!=q)&&($=function(e){var t=B.call(e),r=t==ne?e.constructor:void 0,n=r?E(r):void 0;if(n)switch(n){case er:return N;case tr:return I;case rr:return Ae;case nr:return L;case or:return q}return t});function Rr(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&w.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Jr(e){return typeof e.constructor=="function"&&!at(e)?_r(Qt(e)):{}}function Kr(e,t,r,n){var a=e.constructor;switch(t){case Je:return se(e);case ke:case Ie:return new a(+e);case N:return Mr(e,n);case Ke:case He:case Ue:case Ge:case Qe:case qe:case ze:case Ze:case Xe:return Lr(e,n);case I:return Pr(e,n,r);case Ne:case Be:return new a(e);case Fe:return Wr(e);case L:return kr(e,n,r);case Re:return Ir(e)}}function Hr(e,t){return t=t==null?We:t,!!t&&(typeof e=="number"||Wt.test(e))&&e>-1&&e%1==0&&e<t}function Ur(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Gr(e){return!!_e&&_e in e}function at(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||F;return e===r}function E(e){if(e!=null){try{return rt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Qr(e){return ee(e,!0,!0)}function it(e,t){return e===t||e!==e&&t!==t}function qr(e){return zr(e)&&w.call(e,"callee")&&(!zt.call(e,"callee")||B.call(e)==te)}var ae=Array.isArray;function ut(e){return e!=null&&Xr(e.length)&&!ct(e)}function zr(e){return Yr(e)&&ut(e)}var Zr=Xt||tn;function ct(e){var t=K(e)?B.call(e):"";return t==re||t==Le}function Xr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=We}function K(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Yr(e){return!!e&&typeof e=="object"}function ie(e){return ut(e)?xr(e):Cr(e)}function en(){return[]}function tn(){return!1}j.exports=Qr});var cn={};_t(cn,{compare:()=>pe,defaults:()=>gt,version:()=>an});var _=Se(we(),1);var H=Se(lt(),1);function b(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function rn(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let r=t-1;r--;)if(e[r]===".")return e.slice(r+1,t)}return null}var ue=rn;function ft(e,t){let r={now:!1};function n(a,u,l,o){let s=(0,H.default)(a),f,i=m({depth:-1,path:""},l);if(i.depth+=1,Array.isArray(s))for(let c=0,g=s.length;c<g&&!o.now;c++){let v=i.path?`${i.path}.${c}`:`${c}`;s[c]!==void 0?(i.parent=(0,H.default)(s),i.parentType="array",i.parentKey=ue(v),f=n(u(s[c],void 0,M(m({},i),{path:v}),o),u,M(m({},i),{path:v}),o),Number.isNaN(f)&&c<s.length?(s.splice(c,1),c-=1):s[c]=f):s.splice(c,1)}else if(b(s))for(let c in s){if(o.now&&c!=null)break;let g=i.path?`${i.path}.${c}`:c;i.depth===0&&c!=null&&(i.topmostKey=c),i.parent=(0,H.default)(s),i.parentType="object",i.parentKey=ue(g),f=n(u(c,s[c],M(m({},i),{path:g}),o),u,M(m({},i),{path:g}),o),Number.isNaN(f)?delete s[c]:s[c]=f}return s}return n(e,t,{},r)}function d(e){if(typeof e=="string")return!e.trim();if(!["object","string"].includes(typeof e)||!e)return!1;let t=!0;return e=ft(e,(r,n,a,u)=>{let l=n!==void 0?n:r;return typeof l=="string"&&l.trim()&&(t=!1,u.now=!0),l}),t}function ce(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var le=new Map,pt=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},nn=(e,t)=>{t=m({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(le.has(r))return le.get(r);let n=e[0]==="!";n&&(e=e.slice(1)),e=ce(e).replace(/\\\*/g,"[\\s\\S]*");let a=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return a.negated=n,le.set(r,a),a},on=(e,t,r,n)=>{if(e=pt(e,"inputs"),t=pt(t,"patterns"),t.length===0)return[];t=t.map(l=>nn(l,r));let{allPatterns:a}=r||{},u=[];for(let l of e){let o,s=[...t].fill(!1);for(let[f,i]of t.entries())if(i.test(l)&&(s[f]=!0,o=!i.negated,!o))break;if(!(o===!1||o===void 0&&t.some(f=>!f.negated)||a&&s.some((f,i)=>!f&&!t[i].negated))&&(u.push(l),n))break}return u};function fe(e,t,r){return on(e,t,r,!0).length>0}var yt="4.0.7";var an=yt;function un(e){return b(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var gt={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function pe(e,t,r){let n,a,u,l=0,o=m(m({},gt),r);if(o.hungryForWhitespace&&o.matchStrictly&&b(e)&&d(e)&&b(t)&&!Object.keys(t).length)return!0;if((!o.hungryForWhitespace||o.hungryForWhitespace&&!d(e)&&d(t))&&b(e)&&Object.keys(e).length!==0&&b(t)&&Object.keys(t).length===0||(0,_.default)(e)!==(0,_.default)(t)&&(!o.hungryForWhitespace||o.hungryForWhitespace&&!d(e)))return!1;if(typeof e=="string"&&typeof t=="string")return o.hungryForWhitespace&&d(e)&&d(t)?!0:o.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:o.useWildcards?fe(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(o.hungryForWhitespace&&d(t)&&(!o.matchStrictly||o.matchStrictly&&e.length===t.length))return!0;if(!o.hungryForWhitespace&&t.length>e.length||o.matchStrictly&&t.length!==e.length)return o.verboseWhenMismatches?`The length of a given array, ${JSON.stringify(t,null,4)} is ${t.length} but the length of an array on the other end, ${JSON.stringify(e,null,4)} is ${e.length}`:!1;if(t.length===0)return e.length===0?!0:o.verboseWhenMismatches?`The given array has no elements, but the array on the other end, ${JSON.stringify(e,null,4)} does have some`:!1;for(let s=0,f=t.length;s<f;s++){u=!1;for(let i=l,c=e.length;i<c;i++)if(l+=1,pe(e[i],t[s],o)===!0){u=!0;break}if(!u)return o.verboseWhenMismatches?`The given array ${JSON.stringify(t,null,4)} is not a subset of an array on the other end, ${JSON.stringify(e,null,4)}`:!1}}else if(b(e)&&b(t)){if(n=new Set(Object.keys(t)),a=new Set(Object.keys(e)),o.matchStrictly&&n.size!==a.size){if(!o.verboseWhenMismatches)return!1;let s=new Set([...n].filter(g=>!a.has(g))),f=s.size?` First object has unique keys: ${JSON.stringify(s,null,4)}.`:"",i=new Set([...a].filter(g=>!n.has(g))),c=i.size?` Second object has unique keys:
11
+ ${JSON.stringify(i,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${f}${c}`}for(let s of n){if(!Object.prototype.hasOwnProperty.call(e,s))return!o.useWildcards||o.useWildcards&&!s.includes("*")?o.verboseWhenMismatches?`The given object has key "${s}" which the other-one does not have.`:!1:Object.keys(e).some(f=>fe(f,s,{caseSensitive:!0}))?!0:o.verboseWhenMismatches?`The given object has key "${s}" which the other-one does not have.`:!1;if(e[s]!=null&&(0,_.default)(e[s])!==(0,_.default)(t[s])){if(!(d(e[s])&&d(t[s])&&o.hungryForWhitespace))return o.verboseWhenMismatches?`The given key ${s} is of a different type on both objects. On the first-one, it's ${(0,_.default)(t[s])}, on the second-one, it's ${(0,_.default)(e[s])}`:!1}else if(pe(e[s],t[s],o)!==!0)return o.verboseWhenMismatches?`The given piece ${JSON.stringify(t[s],null,4)} and ${JSON.stringify(e[s],null,4)} don't match.`:!1}}else return o.hungryForWhitespace&&d(e)&&d(t)&&(!o.matchStrictly||o.matchStrictly&&un(t))?!0:e===t;return!0}return jt(cn);})();
12
12
  /**
13
13
  * @name codsen-utils
14
14
  * @fileoverview Various utility functions
15
- * @version 1.1.1
15
+ * @version 1.2.0
16
16
  * @author Roy Revelt, Codsen Ltd
17
17
  * @license MIT
18
18
  * {@link https://codsen.com/os/codsen-utils/}
@@ -28,7 +28,7 @@
28
28
  /**
29
29
  * @name ast-monkey-traverse
30
30
  * @fileoverview Utility library to traverse AST
31
- * @version 4.0.5
31
+ * @version 4.0.6
32
32
  * @author Roy Revelt, Codsen Ltd
33
33
  * @license MIT
34
34
  * {@link https://codsen.com/os/ast-monkey-traverse/}
@@ -36,7 +36,7 @@
36
36
  /**
37
37
  * @name ast-contains-only-empty-space
38
38
  * @fileoverview Does AST contain only empty space?
39
- * @version 4.0.5
39
+ * @version 4.0.6
40
40
  * @author Roy Revelt, Codsen Ltd
41
41
  * @license MIT
42
42
  * {@link https://codsen.com/os/ast-contains-only-empty-space/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-compare",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "description": "Compare anything: AST, objects, arrays, strings and nested thereof",
5
5
  "keywords": [
6
6
  "array",
@@ -77,13 +77,13 @@
77
77
  }
78
78
  },
79
79
  "dependencies": {
80
- "ast-contains-only-empty-space": "^4.0.5",
81
- "codsen-utils": "^1.1.1",
80
+ "ast-contains-only-empty-space": "^4.0.6",
81
+ "codsen-utils": "^1.2.0",
82
82
  "matcher": "^5.0.0",
83
83
  "type-detect": "^4.0.8"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@types/type-detect": "^4.0.1",
87
- "type-fest": "^3.5.0"
87
+ "type-fest": "^3.5.5"
88
88
  }
89
89
  }