ast-compare 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -4
- package/dist/ast-compare.esm.js +3 -3
- package/dist/ast-compare.umd.js +20 -12
- package/package.json +4 -5
- package/types/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [4.0.2](https://github.com/codsen/codsen/compare/ast-compare@4.0.1...ast-compare@4.0.2) (2022-12-06)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package ast-compare
|
|
9
|
-
|
|
10
6
|
## 4.0.0 (2022-12-01)
|
|
11
7
|
|
|
12
8
|
### BREAKING CHANGES
|
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.4
|
|
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 o
|
|
11
|
-
${JSON.stringify(l,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of 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.4";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
|
+
${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};
|
package/dist/ast-compare.umd.js
CHANGED
|
@@ -1,35 +1,43 @@
|
|
|
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.4
|
|
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 _t=Object.create;var M=Object.defineProperty,xt=Object.defineProperties,$t=Object.getOwnPropertyDescriptor,At=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertyNames,ve=Object.getOwnPropertySymbols,Dt=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable;var Oe=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t)=>{for(var r in t||(t={}))Se.call(t,r)&&Oe(e,r,t[r]);if(ve)for(var r of ve(t))Vt.call(t,r)&&Oe(e,r,t[r]);return e},C=(e,t)=>xt(e,At(t));var U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mt=(e,t)=>{for(var r in t)M(e,r,{get:t[r],enumerable:!0})},we=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Tt(t))!Se.call(e,s)&&s!==r&&M(e,s,{get:()=>t[s],enumerable:!(n=$t(t,s))||n.enumerable});return e};var N=(e,t,r)=>(r=e!=null?_t(Dt(e)):{},we(t||!e||!e.__esModule?M(r,"default",{value:e,enumerable:!0}):r,e)),Ct=e=>we(M({},"__esModule",{value:!0}),e);var je=U((q,z)=>{(function(e,t){typeof q=="object"&&typeof z<"u"?z.exports=t():typeof define=="function"&&define.amd?define(t):e.typeDetect=t()})(q,function(){"use strict";var e=typeof Promise=="function",t=typeof self=="object"?self:global,r=typeof Symbol<"u",n=typeof Map<"u",s=typeof Set<"u",c=typeof WeakMap<"u",u=typeof WeakSet<"u",o=typeof DataView<"u",i=r&&typeof Symbol.iterator<"u",f=r&&typeof Symbol.toStringTag<"u",a=s&&typeof Set.prototype.entries=="function",l=n&&typeof Map.prototype.entries=="function",h=a&&Object.getPrototypeOf(new Set().entries()),m=l&&Object.getPrototypeOf(new Map().entries()),j=i&&typeof Array.prototype[Symbol.iterator]=="function",Ot=j&&Object.getPrototypeOf([][Symbol.iterator]()),de=i&&typeof String.prototype[Symbol.iterator]=="function",St=de&&Object.getPrototypeOf(""[Symbol.iterator]()),wt=8,jt=-1;function Et(y){var be=typeof y;if(be!=="object")return be;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 me=f&&y[Symbol.toStringTag];if(typeof me=="string")return me;var g=Object.getPrototypeOf(y);return g===RegExp.prototype?"RegExp":g===Date.prototype?"Date":e&&g===Promise.prototype?"Promise":s&&g===Set.prototype?"Set":n&&g===Map.prototype?"Map":u&&g===WeakSet.prototype?"WeakSet":c&&g===WeakMap.prototype?"WeakMap":o&&g===DataView.prototype?"DataView":n&&g===m?"Map Iterator":s&&g===h?"Set Iterator":j&&g===Ot?"Array Iterator":de&&g===St?"String Iterator":g===null?"Object":Object.prototype.toString.call(y).slice(wt,jt)}return Et})});var ft=U((P,A)=>{var Pt=200,We="__lodash_hash_undefined__",Ie=9007199254740991,ne="[object Arguments]",Wt="[object Array]",Ne="[object Boolean]",ke="[object Date]",It="[object Error]",oe="[object Function]",Le="[object GeneratorFunction]",k="[object Map]",Je="[object Number]",ie="[object Object]",Ee="[object Promise]",Ke="[object RegExp]",L="[object Set]",Fe="[object String]",Re="[object Symbol]",X="[object WeakMap]",He="[object ArrayBuffer]",J="[object DataView]",Be="[object Float32Array]",Ge="[object Float64Array]",Ue="[object Int8Array]",qe="[object Int16Array]",ze="[object Int32Array]",Qe="[object Uint8Array]",Xe="[object Uint8ClampedArray]",Ye="[object Uint16Array]",Ze="[object Uint32Array]",Nt=/[\\^$.*+?()[\]{}|]/g,kt=/\w*$/,Lt=/^\[object .+?Constructor\]$/,Jt=/^(?:0|[1-9]\d*)$/,p={};p[ne]=p[Wt]=p[He]=p[J]=p[Ne]=p[ke]=p[Be]=p[Ge]=p[Ue]=p[qe]=p[ze]=p[k]=p[Je]=p[ie]=p[Ke]=p[L]=p[Fe]=p[Re]=p[Qe]=p[Xe]=p[Ye]=p[Ze]=!0;p[It]=p[oe]=p[X]=!1;var Kt=typeof global=="object"&&global&&global.Object===Object&&global,Ft=typeof self=="object"&&self&&self.Object===Object&&self,v=Kt||Ft||Function("return this")(),et=typeof P=="object"&&P&&!P.nodeType&&P,_e=et&&typeof A=="object"&&A&&!A.nodeType&&A,Rt=_e&&_e.exports===et;function Ht(e,t){return e.set(t[0],t[1]),e}function Bt(e,t){return e.add(t),e}function Gt(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Ut(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}function tt(e,t,r,n){var s=-1,c=e?e.length:0;for(n&&c&&(r=e[++s]);++s<c;)r=t(r,e[s],s,e);return r}function qt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function zt(e,t){return e==null?void 0:e[t]}function rt(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,s){r[++t]=[s,n]}),r}function se(e,t){return function(r){return e(t(r))}}function $e(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Qt=Array.prototype,Xt=Function.prototype,K=Object.prototype,Q=v["__core-js_shared__"],Ae=function(){var e=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),nt=Xt.toString,S=K.hasOwnProperty,F=K.toString,Yt=RegExp("^"+nt.call(S).replace(Nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=Rt?v.Buffer:void 0,De=v.Symbol,Ve=v.Uint8Array,Zt=se(Object.getPrototypeOf,Object),er=Object.create,tr=K.propertyIsEnumerable,rr=Qt.splice,Me=Object.getOwnPropertySymbols,nr=Te?Te.isBuffer:void 0,or=se(Object.keys,Object),Y=V(v,"DataView"),W=V(v,"Map"),Z=V(v,"Promise"),ee=V(v,"Set"),te=V(v,"WeakMap"),I=V(Object,"create"),ir=x(Y),sr=x(W),ar=x(Z),cr=x(ee),lr=x(te),Ce=De?De.prototype:void 0,Pe=Ce?Ce.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 ur(){this.__data__=I?I(null):{}}function fr(e){return this.has(e)&&delete this.__data__[e]}function pr(e){var t=this.__data__;if(I){var r=t[e];return r===We?void 0:r}return S.call(t,e)?t[e]:void 0}function yr(e){var t=this.__data__;return I?t[e]!==void 0:S.call(t,e)}function hr(e,t){var r=this.__data__;return r[e]=I&&t===void 0?We:t,this}_.prototype.clear=ur;_.prototype.delete=fr;_.prototype.get=pr;_.prototype.has=yr;_.prototype.set=hr;function O(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 gr(){this.__data__=[]}function dr(e){var t=this.__data__,r=R(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():rr.call(t,r,1),!0}function br(e){var t=this.__data__,r=R(t,e);return r<0?void 0:t[r][1]}function mr(e){return R(this.__data__,e)>-1}function vr(e,t){var r=this.__data__,n=R(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}O.prototype.clear=gr;O.prototype.delete=dr;O.prototype.get=br;O.prototype.has=mr;O.prototype.set=vr;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 Or(){this.__data__={hash:new _,map:new(W||O),string:new _}}function Sr(e){return H(this,e).delete(e)}function wr(e){return H(this,e).get(e)}function jr(e){return H(this,e).has(e)}function Er(e,t){return H(this,e).set(e,t),this}T.prototype.clear=Or;T.prototype.delete=Sr;T.prototype.get=wr;T.prototype.has=jr;T.prototype.set=Er;function D(e){this.__data__=new O(e)}function _r(){this.__data__=new O}function xr(e){return this.__data__.delete(e)}function $r(e){return this.__data__.get(e)}function Ar(e){return this.__data__.has(e)}function Tr(e,t){var r=this.__data__;if(r instanceof O){var n=r.__data__;if(!W||n.length<Pt-1)return n.push([e,t]),this;r=this.__data__=new T(n)}return r.set(e,t),this}D.prototype.clear=_r;D.prototype.delete=xr;D.prototype.get=$r;D.prototype.has=Ar;D.prototype.set=Tr;function Dr(e,t){var r=ce(e)||en(e)?qt(e.length,String):[],n=r.length,s=!!n;for(var c in e)(t||S.call(e,c))&&!(s&&(c=="length"||Qr(c,n)))&&r.push(c);return r}function ot(e,t,r){var n=e[t];(!(S.call(e,t)&&ct(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function R(e,t){for(var r=e.length;r--;)if(ct(e[r][0],t))return r;return-1}function Vr(e,t){return e&&it(t,le(t),e)}function re(e,t,r,n,s,c,u){var o;if(n&&(o=c?n(e,s,c,u):n(e)),o!==void 0)return o;if(!B(e))return e;var i=ce(e);if(i){if(o=Ur(e),!t)return Hr(e,o)}else{var f=E(e),a=f==oe||f==Le;if(rn(e))return Nr(e,t);if(f==ie||f==ne||a&&!c){if(rt(e))return c?e:{};if(o=qr(a?{}:e),!t)return Br(e,Vr(o,e))}else{if(!p[f])return c?e:{};o=zr(e,f,re,t)}}u||(u=new D);var l=u.get(e);if(l)return l;if(u.set(e,o),!i)var h=r?Gr(e):le(e);return Gt(h||e,function(m,j){h&&(j=m,m=e[j]),ot(o,j,re(m,t,r,n,j,e,u))}),o}function Mr(e){return B(e)?er(e):{}}function Cr(e,t,r){var n=t(e);return ce(e)?n:Ut(n,r(e))}function Pr(e){return F.call(e)}function Wr(e){if(!B(e)||Yr(e))return!1;var t=ut(e)||rt(e)?Yt:Lt;return t.test(x(e))}function Ir(e){if(!at(e))return or(e);var t=[];for(var r in Object(e))S.call(e,r)&&r!="constructor"&&t.push(r);return t}function Nr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function ae(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function kr(e,t){var r=t?ae(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Lr(e,t,r){var n=t?r(xe(e),!0):xe(e);return tt(n,Ht,new e.constructor)}function Jr(e){var t=new e.constructor(e.source,kt.exec(e));return t.lastIndex=e.lastIndex,t}function Kr(e,t,r){var n=t?r($e(e),!0):$e(e);return tt(n,Bt,new e.constructor)}function Fr(e){return Pe?Object(Pe.call(e)):{}}function Rr(e,t){var r=t?ae(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Hr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function it(e,t,r,n){r||(r={});for(var s=-1,c=t.length;++s<c;){var u=t[s],o=n?n(r[u],e[u],u,r,e):void 0;ot(r,u,o===void 0?e[u]:o)}return r}function Br(e,t){return it(e,st(e),t)}function Gr(e){return Cr(e,le,st)}function H(e,t){var r=e.__data__;return Xr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function V(e,t){var r=zt(e,t);return Wr(r)?r:void 0}var st=Me?se(Me,Object):sn,E=Pr;(Y&&E(new Y(new ArrayBuffer(1)))!=J||W&&E(new W)!=k||Z&&E(Z.resolve())!=Ee||ee&&E(new ee)!=L||te&&E(new te)!=X)&&(E=function(e){var t=F.call(e),r=t==ie?e.constructor:void 0,n=r?x(r):void 0;if(n)switch(n){case ir:return J;case sr:return k;case ar:return Ee;case cr:return L;case lr:return X}return t});function Ur(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&S.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function qr(e){return typeof e.constructor=="function"&&!at(e)?Mr(Zt(e)):{}}function zr(e,t,r,n){var s=e.constructor;switch(t){case He:return ae(e);case Ne:case ke:return new s(+e);case J:return kr(e,n);case Be:case Ge:case Ue:case qe:case ze:case Qe:case Xe:case Ye:case Ze:return Rr(e,n);case k:return Lr(e,n,r);case Je:case Fe:return new s(e);case Ke:return Jr(e);case L:return Kr(e,n,r);case Re:return Fr(e)}}function Qr(e,t){return t=t==null?Ie:t,!!t&&(typeof e=="number"||Jt.test(e))&&e>-1&&e%1==0&&e<t}function Xr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Yr(e){return!!Ae&&Ae in e}function at(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||K;return e===r}function x(e){if(e!=null){try{return nt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Zr(e){return re(e,!0,!0)}function ct(e,t){return e===t||e!==e&&t!==t}function en(e){return tn(e)&&S.call(e,"callee")&&(!tr.call(e,"callee")||F.call(e)==ne)}var ce=Array.isArray;function lt(e){return e!=null&&nn(e.length)&&!ut(e)}function tn(e){return on(e)&<(e)}var rn=nr||an;function ut(e){var t=B(e)?F.call(e):"";return t==oe||t==Le}function nn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ie}function B(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function on(e){return!!e&&typeof e=="object"}function le(e){return lt(e)?Dr(e):Ir(e)}function sn(){return[]}function an(){return!1}A.exports=Zr});var ue=U((xn,ht)=>{var cn="[object Object]";function ln(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function un(e,t){return function(r){return e(t(r))}}var fn=Function.prototype,pt=Object.prototype,yt=fn.toString,pn=pt.hasOwnProperty,yn=yt.call(Object),hn=pt.toString,gn=un(Object.getPrototypeOf,Object);function dn(e){return!!e&&typeof e=="object"}function bn(e){if(!dn(e)||hn.call(e)!=cn||ln(e))return!1;var t=gn(e);if(t===null)return!0;var r=pn.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&yt.call(r)==yn}ht.exports=bn});var En={};Mt(En,{compare:()=>ge,defaults:()=>vt,version:()=>wn});var $=N(je(),1);var G=N(ft(),1),gt=N(ue(),1);function mn(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 fe=mn;function dt(e,t){let r={now:!1};function n(s,c,u,o){let i=(0,G.default)(s),f,a=b({depth:-1,path:""},u);if(a.depth+=1,Array.isArray(i))for(let l=0,h=i.length;l<h&&!o.now;l++){let m=a.path?`${a.path}.${l}`:`${l}`;i[l]!==void 0?(a.parent=(0,G.default)(i),a.parentType="array",a.parentKey=fe(m),f=n(c(i[l],void 0,C(b({},a),{path:m}),o),c,C(b({},a),{path:m}),o),Number.isNaN(f)&&l<i.length?(i.splice(l,1),l-=1):i[l]=f):i.splice(l,1)}else if((0,gt.default)(i))for(let l in i){if(o.now&&l!=null)break;let h=a.path?`${a.path}.${l}`:l;a.depth===0&&l!=null&&(a.topmostKey=l),a.parent=(0,G.default)(i),a.parentType="object",a.parentKey=fe(h),f=n(c(l,i[l],C(b({},a),{path:h}),o),c,C(b({},a),{path:h}),o),Number.isNaN(f)?delete i[l]:i[l]=f}return i}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=dt(e,(r,n,s,c)=>{let u=n!==void 0?n:r;return typeof u=="string"&&u.trim()&&(t=!1,c.now=!0),u}),t}var w=N(ue(),1);function pe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ye=new Map,bt=(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})},vn=(e,t)=>{t=b({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(ye.has(r))return ye.get(r);let n=e[0]==="!";n&&(e=e.slice(1)),e=pe(e).replace(/\\\*/g,"[\\s\\S]*");let s=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return s.negated=n,ye.set(r,s),s},On=(e,t,r,n)=>{if(e=bt(e,"inputs"),t=bt(t,"patterns"),t.length===0)return[];t=t.map(u=>vn(u,r));let{allPatterns:s}=r||{},c=[];for(let u of e){let o,i=[...t].fill(!1);for(let[f,a]of t.entries())if(a.test(u)&&(i[f]=!0,o=!a.negated,!o))break;if(!(o===!1||o===void 0&&t.some(f=>!f.negated)||s&&i.some((f,a)=>!f&&!t[a].negated))&&(c.push(u),n))break}return c};function he(e,t,r){return On(e,t,r,!0).length>0}var mt="4.0.2";var wn=mt;function jn(e){return(0,w.default)(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var vt={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function ge(e,t,r){let n,s,c,u=0,o=b(b({},vt),r);if(o.hungryForWhitespace&&o.matchStrictly&&(0,w.default)(e)&&d(e)&&(0,w.default)(t)&&!Object.keys(t).length)return!0;if((!o.hungryForWhitespace||o.hungryForWhitespace&&!d(e)&&d(t))&&(0,w.default)(e)&&Object.keys(e).length!==0&&(0,w.default)(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?he(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 i=0,f=t.length;i<f;i++){c=!1;for(let a=u,l=e.length;a<l;a++)if(u+=1,ge(e[a],t[i],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((0,w.default)(e)&&(0,w.default)(t)){if(n=new Set(Object.keys(t)),s=new Set(Object.keys(e)),o.matchStrictly&&n.size!==s.size){if(!o.verboseWhenMismatches)return!1;let i=new Set([...n].filter(h=>!s.has(h))),f=i.size?` First object has unique keys: ${JSON.stringify(i,null,4)}.`:"",a=new Set([...s].filter(h=>!n.has(h))),l=a.size?` Second object has unique keys:
|
|
11
|
-
${JSON.stringify(
|
|
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.4";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);})();
|
|
12
12
|
/**
|
|
13
|
-
* @name
|
|
14
|
-
* @fileoverview
|
|
15
|
-
* @version
|
|
13
|
+
* @name codsen-utils
|
|
14
|
+
* @fileoverview Various utility functions
|
|
15
|
+
* @version 1.1.0
|
|
16
16
|
* @author Roy Revelt, Codsen Ltd
|
|
17
17
|
* @license MIT
|
|
18
|
-
* {@link https://codsen.com/os/
|
|
18
|
+
* {@link https://codsen.com/os/codsen-utils/}
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* @name ast-monkey-util
|
|
22
|
+
* @fileoverview Utility library of AST helper functions
|
|
23
|
+
* @version 3.0.3
|
|
24
|
+
* @author Roy Revelt, Codsen Ltd
|
|
25
|
+
* @license MIT
|
|
26
|
+
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
19
27
|
*/
|
|
20
28
|
/**
|
|
21
29
|
* @name ast-monkey-traverse
|
|
22
30
|
* @fileoverview Utility library to traverse AST
|
|
23
|
-
* @version 4.0.
|
|
31
|
+
* @version 4.0.4
|
|
24
32
|
* @author Roy Revelt, Codsen Ltd
|
|
25
33
|
* @license MIT
|
|
26
34
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
27
35
|
*/
|
|
28
36
|
/**
|
|
29
|
-
* @name ast-
|
|
30
|
-
* @fileoverview
|
|
31
|
-
* @version
|
|
37
|
+
* @name ast-contains-only-empty-space
|
|
38
|
+
* @fileoverview Does AST contain only empty space?
|
|
39
|
+
* @version 4.0.4
|
|
32
40
|
* @author Roy Revelt, Codsen Ltd
|
|
33
41
|
* @license MIT
|
|
34
|
-
* {@link https://codsen.com/os/ast-
|
|
42
|
+
* {@link https://codsen.com/os/ast-contains-only-empty-space/}
|
|
35
43
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-compare",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Compare anything: AST, objects, arrays, strings and nested thereof",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -77,14 +77,13 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"ast-contains-only-empty-space": "^4.0.
|
|
81
|
-
"
|
|
80
|
+
"ast-contains-only-empty-space": "^4.0.4",
|
|
81
|
+
"codsen-utils": "^1.1.0",
|
|
82
82
|
"matcher": "^5.0.0",
|
|
83
83
|
"type-detect": "^4.0.8"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@types/lodash.isplainobject": "^4.0.7",
|
|
87
86
|
"@types/type-detect": "^4.0.1",
|
|
88
|
-
"type-fest": "^3.
|
|
87
|
+
"type-fest": "^3.5.0"
|
|
89
88
|
}
|
|
90
89
|
}
|
package/types/index.d.ts
CHANGED
|
File without changes
|