ast-compare 4.0.7 → 4.0.9
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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/ast-compare.esm.js +3 -3
- package/dist/ast-compare.umd.js +7 -7
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2023 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -70,6 +70,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
70
70
|
|
|
71
71
|
MIT License.
|
|
72
72
|
|
|
73
|
-
Copyright © 2010-
|
|
73
|
+
Copyright © 2010-2023 Roy Revelt and other contributors.
|
|
74
74
|
|
|
75
75
|
<p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
|
package/dist/ast-compare.esm.js
CHANGED
|
@@ -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.
|
|
4
|
+
* @version 4.0.9
|
|
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.
|
|
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(!
|
|
10
|
+
import i from"type-detect";import{empty as s}from"ast-contains-only-empty-space";import{isPlainObject as o,hasOwnProp as O}from"codsen-utils";import{isMatch as m}from"matcher";var f="4.0.9";var x=f;function V(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
|
+
${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(!O(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&&V(t))?!0:e===t;return!0}export{d as compare,j as defaults,x as version};
|
package/dist/ast-compare.umd.js
CHANGED
|
@@ -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.
|
|
4
|
+
* @version 4.0.9
|
|
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,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(!
|
|
10
|
+
"use strict";var astCompare=(()=>{var St=Object.create;var V=Object.defineProperty,wt=Object.defineProperties,At=Object.getOwnPropertyDescriptor,xt=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,Et=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,_t=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))_t.call(t,r)&&me(e,r,t[r]);return e},M=(e,t)=>wt(e,xt(t));var ve=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jt=(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=At(t,a))||n.enumerable});return e};var Se=(e,t,r)=>(r=e!=null?St(Et(e)):{},Oe(t||!e||!e.__esModule?V(r,"default",{value:e,enumerable:!0}):r,e)),Dt=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",y=i&&Object.getPrototypeOf(new Set().entries()),v=c&&Object.getPrototypeOf(new Map().entries()),A=s&&typeof Array.prototype[Symbol.iterator]=="function",dt=A&&Object.getPrototypeOf([][Symbol.iterator]()),he=s&&typeof String.prototype[Symbol.iterator]=="function",mt=he&&Object.getPrototypeOf(""[Symbol.iterator]()),bt=8,vt=-1;function Ot(h){var ye=typeof h;if(ye!=="object")return ye;if(h===null)return"null";if(h===t)return"global";if(Array.isArray(h)&&(f===!1||!(Symbol.toStringTag in h)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&h===window.location)return"Location";if(typeof window.document=="object"&&h===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&h===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&h===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&h instanceof window.HTMLElement){if(h.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(h.tagName==="TD")return"HTMLTableDataCellElement";if(h.tagName==="TH")return"HTMLTableHeaderCellElement"}}var ge=f&&h[Symbol.toStringTag];if(typeof ge=="string")return ge;var g=Object.getPrototypeOf(h);return g===RegExp.prototype?"RegExp":g===Date.prototype?"Date":e&&g===Promise.prototype?"Promise":a&&g===Set.prototype?"Set":n&&g===Map.prototype?"Map":l&&g===WeakSet.prototype?"WeakSet":u&&g===WeakMap.prototype?"WeakMap":o&&g===DataView.prototype?"DataView":n&&g===v?"Map Iterator":a&&g===y?"Set Iterator":A&&g===dt?"Array Iterator":he&&g===mt?"String Iterator":g===null?"Object":Object.prototype.toString.call(h).slice(bt,vt)}return Ot})});var lt=ve((P,j)=>{var Tt=200,Pe="__lodash_hash_undefined__",Ie=9007199254740991,te="[object Arguments]",Ct="[object Array]",We="[object Boolean]",ke="[object Date]",Vt="[object Error]",re="[object Function]",Ne="[object GeneratorFunction]",k="[object Map]",Le="[object Number]",ne="[object Object]",Ae="[object Promise]",Fe="[object RegExp]",N="[object Set]",Be="[object String]",Je="[object Symbol]",Q="[object WeakMap]",Ke="[object ArrayBuffer]",L="[object DataView]",Re="[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]",Mt=/[\\^$.*+?()[\]{}|]/g,Pt=/\w*$/,It=/^\[object .+?Constructor\]$/,Wt=/^(?:0|[1-9]\d*)$/,p={};p[te]=p[Ct]=p[Ke]=p[L]=p[We]=p[ke]=p[Re]=p[He]=p[Ue]=p[Ge]=p[qe]=p[k]=p[Le]=p[ne]=p[Fe]=p[N]=p[Be]=p[Je]=p[Qe]=p[ze]=p[Ze]=p[Xe]=!0;p[Vt]=p[re]=p[Q]=!1;var kt=typeof global=="object"&&global&&global.Object===Object&&global,Nt=typeof self=="object"&&self&&self.Object===Object&&self,O=kt||Nt||Function("return this")(),Ye=typeof P=="object"&&P&&!P.nodeType&&P,xe=Ye&&typeof j=="object"&&j&&!j.nodeType&&j,Lt=xe&&xe.exports===Ye;function Ft(e,t){return e.set(t[0],t[1]),e}function Bt(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,u=e?e.length:0;for(n&&u&&(r=e[++a]);++a<u;)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 Ee(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Ut=Array.prototype,Gt=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=Gt.toString,w=F.hasOwnProperty,B=F.toString,qt=RegExp("^"+rt.call(w).replace(Mt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=Lt?O.Buffer:void 0,De=O.Symbol,Te=O.Uint8Array,Qt=oe(Object.getPrototypeOf,Object),zt=Object.create,Zt=F.propertyIsEnumerable,Xt=Ut.splice,Ce=Object.getOwnPropertySymbols,Yt=je?je.isBuffer:void 0,er=oe(Object.keys,Object),z=C(O,"DataView"),I=C(O,"Map"),Z=C(O,"Promise"),X=C(O,"Set"),Y=C(O,"WeakMap"),W=C(Object,"create"),tr=E(z),rr=E(I),nr=E(Z),or=E(X),sr=E(Y),Ve=De?De.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 ar(){this.__data__=W?W(null):{}}function ir(e){return this.has(e)&&delete this.__data__[e]}function ur(e){var t=this.__data__;if(W){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 W?t[e]!==void 0:w.call(t,e)}function lr(e,t){var r=this.__data__;return r[e]=W&&t===void 0?Pe:t,this}$.prototype.clear=ar;$.prototype.delete=ir;$.prototype.get=ur;$.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 fr(){this.__data__=[]}function pr(e){var t=this.__data__,r=J(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Xt.call(t,r,1),!0}function hr(e){var t=this.__data__,r=J(t,e);return r<0?void 0:t[r][1]}function yr(e){return J(this.__data__,e)>-1}function gr(e,t){var r=this.__data__,n=J(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}S.prototype.clear=fr;S.prototype.delete=pr;S.prototype.get=hr;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 dr(){this.__data__={hash:new $,map:new(I||S),string:new $}}function mr(e){return K(this,e).delete(e)}function br(e){return K(this,e).get(e)}function vr(e){return K(this,e).has(e)}function Or(e,t){return K(this,e).set(e,t),this}D.prototype.clear=dr;D.prototype.delete=mr;D.prototype.get=br;D.prototype.has=vr;D.prototype.set=Or;function T(e){this.__data__=new S(e)}function Sr(){this.__data__=new S}function wr(e){return this.__data__.delete(e)}function Ar(e){return this.__data__.get(e)}function xr(e){return this.__data__.has(e)}function $r(e,t){var r=this.__data__;if(r instanceof S){var n=r.__data__;if(!I||n.length<Tt-1)return n.push([e,t]),this;r=this.__data__=new D(n)}return r.set(e,t),this}T.prototype.clear=Sr;T.prototype.delete=wr;T.prototype.get=Ar;T.prototype.has=xr;T.prototype.set=$r;function Er(e,t){var r=ae(e)||zr(e)?Rt(e.length,String):[],n=r.length,a=!!n;for(var u in e)(t||w.call(e,u))&&!(a&&(u=="length"||Ur(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 J(e,t){for(var r=e.length;r--;)if(it(e[r][0],t))return r;return-1}function _r(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(!R(e))return e;var s=ae(e);if(s){if(o=Kr(e),!t)return Fr(e,o)}else{var f=x(e),i=f==re||f==Ne;if(Xr(e))return Mr(e,t);if(f==ne||f==te||i&&!u){if(tt(e))return u?e:{};if(o=Rr(i?{}:e),!t)return Br(e,_r(o,e))}else{if(!p[f])return u?e:{};o=Hr(e,f,ee,t)}}l||(l=new T);var c=l.get(e);if(c)return c;if(l.set(e,o),!s)var y=r?Jr(e):ie(e);return Jt(y||e,function(v,A){y&&(A=v,v=e[A]),nt(o,A,ee(v,t,r,n,A,e,l))}),o}function jr(e){return R(e)?zt(e):{}}function Dr(e,t,r){var n=t(e);return ae(e)?n:Kt(n,r(e))}function Tr(e){return B.call(e)}function Cr(e){if(!R(e)||qr(e))return!1;var t=ct(e)||tt(e)?qt:It;return t.test(E(e))}function Vr(e){if(!at(e))return er(e);var t=[];for(var r in Object(e))w.call(e,r)&&r!="constructor"&&t.push(r);return t}function Mr(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 Pr(e,t){var r=t?se(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Ir(e,t,r){var n=t?r($e(e),!0):$e(e);return et(n,Ft,new e.constructor)}function Wr(e){var t=new e.constructor(e.source,Pt.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,Bt,new e.constructor)}function Nr(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 Fr(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 Br(e,t){return ot(e,st(e),t)}function Jr(e){return Dr(e,ie,st)}function K(e,t){var r=e.__data__;return Gr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function C(e,t){var r=Ht(e,t);return Cr(r)?r:void 0}var st=Ce?oe(Ce,Object):tn,x=Tr;(z&&x(new z(new ArrayBuffer(1)))!=L||I&&x(new I)!=k||Z&&x(Z.resolve())!=Ae||X&&x(new X)!=N||Y&&x(new Y)!=Q)&&(x=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 tr:return L;case rr:return k;case nr:return Ae;case or:return N;case sr: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)?jr(Qt(e)):{}}function Hr(e,t,r,n){var a=e.constructor;switch(t){case Ke:return se(e);case We:case ke:return new a(+e);case L:return Pr(e,n);case Re:case He:case Ue:case Ge:case qe:case Qe:case ze:case Ze:case Xe:return Lr(e,n);case k:return Ir(e,n,r);case Le:case Be:return new a(e);case Fe:return Wr(e);case N:return kr(e,n,r);case Je:return Nr(e)}}function Ur(e,t){return t=t==null?Ie:t,!!t&&(typeof e=="number"||Wt.test(e))&&e>-1&&e%1==0&&e<t}function Gr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qr(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 zr(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&&Yr(e.length)&&!ct(e)}function Zr(e){return en(e)&&ut(e)}var Xr=Yt||rn;function ct(e){var t=R(e)?B.call(e):"";return t==re||t==Ne}function Yr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ie}function R(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function en(e){return!!e&&typeof e=="object"}function ie(e){return ut(e)?Er(e):Vr(e)}function tn(){return[]}function rn(){return!1}j.exports=Qr});var fn={};jt(fn,{compare:()=>pe,defaults:()=>gt,version:()=>cn});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 nn(e){return typeof e=="string"}function ft(e,t){return b(e)&&nn(t)&&Object.prototype.hasOwnProperty.call(e,t)}function on(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=on;function pt(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,y=s.length;c<y&&!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 y=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(y),f=n(u(c,s[c],M(m({},i),{path:y}),o),u,M(m({},i),{path:y}),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=pt(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,ht=(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})},sn=(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},an=(e,t,r,n)=>{if(e=ht(e,"inputs"),t=ht(t,"patterns"),t.length===0)return[];t=t.map(l=>sn(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 an(e,t,r,!0).length>0}var yt="4.0.9";var cn=yt;function ln(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(y=>!a.has(y))),f=s.size?` First object has unique keys: ${JSON.stringify(s,null,4)}.`:"",i=new Set([...a].filter(y=>!n.has(y))),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(!ft(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&&ln(t))?!0:e===t;return!0}return Dt(fn);})();
|
|
12
12
|
/**
|
|
13
13
|
* @name codsen-utils
|
|
14
14
|
* @fileoverview Various utility functions
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.3.0
|
|
16
16
|
* @author Roy Revelt, Codsen Ltd
|
|
17
17
|
* @license MIT
|
|
18
18
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
/**
|
|
21
21
|
* @name ast-monkey-util
|
|
22
22
|
* @fileoverview Utility library of AST helper functions
|
|
23
|
-
* @version 3.0.
|
|
23
|
+
* @version 3.0.4
|
|
24
24
|
* @author Roy Revelt, Codsen Ltd
|
|
25
25
|
* @license MIT
|
|
26
26
|
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
/**
|
|
29
29
|
* @name ast-monkey-traverse
|
|
30
30
|
* @fileoverview Utility library to traverse AST
|
|
31
|
-
* @version 4.0.
|
|
31
|
+
* @version 4.0.7
|
|
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.
|
|
39
|
+
* @version 4.0.7
|
|
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.
|
|
3
|
+
"version": "4.0.9",
|
|
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.
|
|
81
|
-
"codsen-utils": "^1.
|
|
80
|
+
"ast-contains-only-empty-space": "^4.0.7",
|
|
81
|
+
"codsen-utils": "^1.3.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.
|
|
87
|
+
"type-fest": "^3.6.1"
|
|
88
88
|
}
|
|
89
89
|
}
|