ast-compare 3.0.10 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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
+ # 3.1.0 (2022-04-10)
7
+
8
+ ### Features
9
+
10
+ - export defaults and version ([191d365](https://github.com/codsen/codsen/commit/191d36502877ef73e8c981bb668b3348ed4c2876))
11
+
6
12
  ## 3.0.0 (2021-09-09)
7
13
 
8
14
  ### Features
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2021 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2022 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
@@ -75,8 +75,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
75
75
 
76
76
  MIT License
77
77
 
78
- Copyright (c) 2010-2021 Roy Revelt and other contributors
79
-
78
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
80
79
 
81
80
  <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">
82
-
@@ -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 3.0.10
4
+ * @version 3.1.0
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 a from"type-detect";import{empty as o}from"ast-contains-only-empty-space";import s from"lodash.isplainobject";import{isMatch as $}from"matcher";function O(e){return s(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}function m(e,t,b){let i,u,h,f=0,n={...{hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1},...b};if(n.hungryForWhitespace&&n.matchStrictly&&s(e)&&o(e)&&s(t)&&!Object.keys(t).length)return!0;if((!n.hungryForWhitespace||n.hungryForWhitespace&&!o(e)&&o(t))&&s(e)&&Object.keys(e).length!==0&&s(t)&&Object.keys(t).length===0||a(e)!==a(t)&&(!n.hungryForWhitespace||n.hungryForWhitespace&&!o(e)))return!1;if(typeof e=="string"&&typeof t=="string")return n.hungryForWhitespace&&o(e)&&o(t)?!0:n.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:n.useWildcards?$(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(n.hungryForWhitespace&&o(t)&&(!n.matchStrictly||n.matchStrictly&&e.length===t.length))return!0;if(!n.hungryForWhitespace&&t.length>e.length||n.matchStrictly&&t.length!==e.length)return n.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:n.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 r=0,c=t.length;r<c;r++){h=!1;for(let l=f,y=e.length;l<y;l++)if(f+=1,m(e[l],t[r],n)===!0){h=!0;break}if(!h)return n.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(s(e)&&s(t)){if(i=new Set(Object.keys(t)),u=new Set(Object.keys(e)),n.matchStrictly&&i.size!==u.size){if(!n.verboseWhenMismatches)return!1;let r=new Set([...i].filter(g=>!u.has(g))),c=r.size?` First object has unique keys: ${JSON.stringify(r,null,4)}.`:"",l=new Set([...u].filter(g=>!i.has(g))),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.${c}${y}`}for(let r of i){if(!Object.prototype.hasOwnProperty.call(e,r))return!n.useWildcards||n.useWildcards&&!r.includes("*")?n.verboseWhenMismatches?`The given object has key "${r}" which the other-one does not have.`:!1:Object.keys(e).some(c=>$(c,r,{caseSensitive:!0}))?!0:n.verboseWhenMismatches?`The given object has key "${r}" which the other-one does not have.`:!1;if(e[r]!=null&&a(e[r])!==a(t[r])){if(!(o(e[r])&&o(t[r])&&n.hungryForWhitespace))return n.verboseWhenMismatches?`The given key ${r} is of a different type on both objects. On the first-one, it's ${a(t[r])}, on the second-one, it's ${a(e[r])}`:!1}else if(m(e[r],t[r],n)!==!0)return n.verboseWhenMismatches?`The given piece ${JSON.stringify(t[r],null,4)} and ${JSON.stringify(e[r],null,4)} don't match.`:!1}}else return n.hungryForWhitespace&&o(e)&&o(t)&&(!n.matchStrictly||n.matchStrictly&&O(t))?!0:e===t;return!0}export{m as compare};
10
+ import a from"type-detect";import{empty as s}from"ast-contains-only-empty-space";import o from"lodash.isplainobject";import{isMatch as m}from"matcher";var f="3.1.0";var W=f;function O(e){return o(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var V={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function d(e,t,b){let i,u,y,p=0,r={...V,...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||a(e)!==a(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,c=t.length;n<c;n++){y=!1;for(let l=p,h=e.length;l<h;l++)if(p+=1,d(e[l],t[n],r)===!0){y=!0;break}if(!y)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(i=new Set(Object.keys(t)),u=new Set(Object.keys(e)),r.matchStrictly&&i.size!==u.size){if(!r.verboseWhenMismatches)return!1;let n=new Set([...i].filter(g=>!u.has(g))),c=n.size?` First object has unique keys: ${JSON.stringify(n,null,4)}.`:"",l=new Set([...u].filter(g=>!i.has(g))),h=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.${c}${h}`}for(let n of i){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(c=>m(c,n,{caseSensitive:!0}))?!0:r.verboseWhenMismatches?`The given object has key "${n}" which the other-one does not have.`:!1;if(e[n]!=null&&a(e[n])!==a(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 ${a(t[n])}, on the second-one, it's ${a(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,V 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 3.0.10
4
+ * @version 3.1.0
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
- var astCompare=(()=>{var Et=Object.create;var M=Object.defineProperty,$t=Object.defineProperties,jt=Object.getOwnPropertyDescriptor,At=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertyNames,Oe=Object.getOwnPropertySymbols,xt=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable;var Se=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))ve.call(t,r)&&Se(e,r,t[r]);if(Oe)for(var r of Oe(t))Dt.call(t,r)&&Se(e,r,t[r]);return e},C=(e,t)=>$t(e,At(t)),we=e=>M(e,"__esModule",{value:!0});var U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vt=(e,t)=>{for(var r in t)M(e,r,{get:t[r],enumerable:!0})},_e=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tt(t))!ve.call(e,i)&&(r||i!=="default")&&M(e,i,{get:()=>t[i],enumerable:!(n=jt(t,i))||n.enumerable});return e},N=(e,t)=>_e(we(M(e!=null?Et(xt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Mt=(e=>(t,r)=>e&&e.get(t)||(r=_e(we({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ee=U((q,z)=>{(function(e,t){typeof q=="object"&&typeof z!="undefined"?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!="undefined",n=typeof Map!="undefined",i=typeof Set!="undefined",u=typeof WeakMap!="undefined",f=typeof WeakSet!="undefined",l=typeof DataView!="undefined",o=r&&typeof Symbol.iterator!="undefined",a=r&&typeof Symbol.toStringTag!="undefined",s=i&&typeof Set.prototype.entries=="function",c=n&&typeof Map.prototype.entries=="function",g=s&&Object.getPrototypeOf(new Set().entries()),h=c&&Object.getPrototypeOf(new Map().entries()),_=o&&typeof Array.prototype[Symbol.iterator]=="function",Ot=_&&Object.getPrototypeOf([][Symbol.iterator]()),de=o&&typeof String.prototype[Symbol.iterator]=="function",vt=de&&Object.getPrototypeOf(""[Symbol.iterator]()),St=8,wt=-1;function _t(y){var be=typeof y;if(be!=="object")return be;if(y===null)return"null";if(y===t)return"global";if(Array.isArray(y)&&(a===!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=a&&y[Symbol.toStringTag];if(typeof me=="string")return me;var d=Object.getPrototypeOf(y);return d===RegExp.prototype?"RegExp":d===Date.prototype?"Date":e&&d===Promise.prototype?"Promise":i&&d===Set.prototype?"Set":n&&d===Map.prototype?"Map":f&&d===WeakSet.prototype?"WeakSet":u&&d===WeakMap.prototype?"WeakMap":l&&d===DataView.prototype?"DataView":n&&d===h?"Map Iterator":i&&d===g?"Set Iterator":_&&d===Ot?"Array Iterator":de&&d===vt?"String Iterator":d===null?"Object":Object.prototype.toString.call(y).slice(St,wt)}return _t})});var pt=U((I,V)=>{var Ct=200,$e="__lodash_hash_undefined__",je=9007199254740991,Q="[object Arguments]",Pt="[object Array]",Ae="[object Boolean]",Te="[object Date]",Wt="[object Error]",X="[object Function]",xe="[object GeneratorFunction]",k="[object Map]",De="[object Number]",Y="[object Object]",Ve="[object Promise]",Me="[object RegExp]",L="[object Set]",Ce="[object String]",Pe="[object Symbol]",Z="[object WeakMap]",We="[object ArrayBuffer]",J="[object DataView]",Ie="[object Float32Array]",Ne="[object Float64Array]",ke="[object Int8Array]",Le="[object Int16Array]",Je="[object Int32Array]",Ke="[object Uint8Array]",Fe="[object Uint8ClampedArray]",He="[object Uint16Array]",Re="[object Uint32Array]",It=/[\\^$.*+?()[\]{}|]/g,Nt=/\w*$/,kt=/^\[object .+?Constructor\]$/,Lt=/^(?:0|[1-9]\d*)$/,p={};p[Q]=p[Pt]=p[We]=p[J]=p[Ae]=p[Te]=p[Ie]=p[Ne]=p[ke]=p[Le]=p[Je]=p[k]=p[De]=p[Y]=p[Me]=p[L]=p[Ce]=p[Pe]=p[Ke]=p[Fe]=p[He]=p[Re]=!0;p[Wt]=p[X]=p[Z]=!1;var Jt=typeof global=="object"&&global&&global.Object===Object&&global,Kt=typeof self=="object"&&self&&self.Object===Object&&self,O=Jt||Kt||Function("return this")(),Be=typeof I=="object"&&I&&!I.nodeType&&I,Ge=Be&&typeof V=="object"&&V&&!V.nodeType&&V,Ft=Ge&&Ge.exports===Be;function Ht(e,t){return e.set(t[0],t[1]),e}function Rt(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 Gt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Ue(e,t,r,n){var i=-1,u=e?e.length:0;for(n&&u&&(r=e[++i]);++i<u;)r=t(r,e[i],i,e);return r}function Ut(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function qt(e,t){return e==null?void 0:e[t]}function qe(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function ze(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function ee(e,t){return function(r){return e(t(r))}}function Qe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var zt=Array.prototype,Qt=Function.prototype,K=Object.prototype,te=O["__core-js_shared__"],Xe=function(){var e=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ye=Qt.toString,S=K.hasOwnProperty,F=K.toString,Xt=RegExp("^"+Ye.call(S).replace(It,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ze=Ft?O.Buffer:void 0,et=O.Symbol,tt=O.Uint8Array,Yt=ee(Object.getPrototypeOf,Object),Zt=Object.create,er=K.propertyIsEnumerable,tr=zt.splice,rt=Object.getOwnPropertySymbols,rr=Ze?Ze.isBuffer:void 0,nr=ee(Object.keys,Object),re=D(O,"DataView"),P=D(O,"Map"),ne=D(O,"Promise"),oe=D(O,"Set"),ae=D(O,"WeakMap"),W=D(Object,"create"),or=j(re),ar=j(P),ir=j(ne),sr=j(oe),cr=j(ae),nt=et?et.prototype:void 0,ot=nt?nt.valueOf:void 0;function E(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__=W?W(null):{}}function lr(e){return this.has(e)&&delete this.__data__[e]}function fr(e){var t=this.__data__;if(W){var r=t[e];return r===$e?void 0:r}return S.call(t,e)?t[e]:void 0}function pr(e){var t=this.__data__;return W?t[e]!==void 0:S.call(t,e)}function yr(e,t){var r=this.__data__;return r[e]=W&&t===void 0?$e:t,this}E.prototype.clear=ur;E.prototype.delete=lr;E.prototype.get=fr;E.prototype.has=pr;E.prototype.set=yr;function v(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 hr(e){var t=this.__data__,r=H(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():tr.call(t,r,1),!0}function dr(e){var t=this.__data__,r=H(t,e);return r<0?void 0:t[r][1]}function br(e){return H(this.__data__,e)>-1}function mr(e,t){var r=this.__data__,n=H(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}v.prototype.clear=gr;v.prototype.delete=hr;v.prototype.get=dr;v.prototype.has=br;v.prototype.set=mr;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 E,map:new(P||v),string:new E}}function vr(e){return R(this,e).delete(e)}function Sr(e){return R(this,e).get(e)}function wr(e){return R(this,e).has(e)}function _r(e,t){return R(this,e).set(e,t),this}T.prototype.clear=Or;T.prototype.delete=vr;T.prototype.get=Sr;T.prototype.has=wr;T.prototype.set=_r;function x(e){this.__data__=new v(e)}function Er(){this.__data__=new v}function $r(e){return this.__data__.delete(e)}function jr(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 v){var n=r.__data__;if(!P||n.length<Ct-1)return n.push([e,t]),this;r=this.__data__=new T(n)}return r.set(e,t),this}x.prototype.clear=Er;x.prototype.delete=$r;x.prototype.get=jr;x.prototype.has=Ar;x.prototype.set=Tr;function xr(e,t){var r=ce(e)||Zr(e)?Ut(e.length,String):[],n=r.length,i=!!n;for(var u in e)(t||S.call(e,u))&&!(i&&(u=="length"||zr(u,n)))&&r.push(u);return r}function at(e,t,r){var n=e[t];(!(S.call(e,t)&&ut(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function H(e,t){for(var r=e.length;r--;)if(ut(e[r][0],t))return r;return-1}function Dr(e,t){return e&&it(t,ue(t),e)}function ie(e,t,r,n,i,u,f){var l;if(n&&(l=u?n(e,i,u,f):n(e)),l!==void 0)return l;if(!B(e))return e;var o=ce(e);if(o){if(l=Gr(e),!t)return Hr(e,l)}else{var a=$(e),s=a==X||a==xe;if(tn(e))return Ir(e,t);if(a==Y||a==Q||s&&!u){if(qe(e))return u?e:{};if(l=Ur(s?{}:e),!t)return Rr(e,Dr(l,e))}else{if(!p[a])return u?e:{};l=qr(e,a,ie,t)}}f||(f=new x);var c=f.get(e);if(c)return c;if(f.set(e,l),!o)var g=r?Br(e):ue(e);return Bt(g||e,function(h,_){g&&(_=h,h=e[_]),at(l,_,ie(h,t,r,n,_,e,f))}),l}function Vr(e){return B(e)?Zt(e):{}}function Mr(e,t,r){var n=t(e);return ce(e)?n:Gt(n,r(e))}function Cr(e){return F.call(e)}function Pr(e){if(!B(e)||Xr(e))return!1;var t=ft(e)||qe(e)?Xt:kt;return t.test(j(e))}function Wr(e){if(!ct(e))return nr(e);var t=[];for(var r in Object(e))S.call(e,r)&&r!="constructor"&&t.push(r);return t}function Ir(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 tt(t).set(new tt(e)),t}function Nr(e,t){var r=t?se(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function kr(e,t,r){var n=t?r(ze(e),!0):ze(e);return Ue(n,Ht,new e.constructor)}function Lr(e){var t=new e.constructor(e.source,Nt.exec(e));return t.lastIndex=e.lastIndex,t}function Jr(e,t,r){var n=t?r(Qe(e),!0):Qe(e);return Ue(n,Rt,new e.constructor)}function Kr(e){return ot?Object(ot.call(e)):{}}function Fr(e,t){var r=t?se(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 i=-1,u=t.length;++i<u;){var f=t[i],l=n?n(r[f],e[f],f,r,e):void 0;at(r,f,l===void 0?e[f]:l)}return r}function Rr(e,t){return it(e,st(e),t)}function Br(e){return Mr(e,ue,st)}function R(e,t){var r=e.__data__;return Qr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function D(e,t){var r=qt(e,t);return Pr(r)?r:void 0}var st=rt?ee(rt,Object):on,$=Cr;(re&&$(new re(new ArrayBuffer(1)))!=J||P&&$(new P)!=k||ne&&$(ne.resolve())!=Ve||oe&&$(new oe)!=L||ae&&$(new ae)!=Z)&&($=function(e){var t=F.call(e),r=t==Y?e.constructor:void 0,n=r?j(r):void 0;if(n)switch(n){case or:return J;case ar:return k;case ir:return Ve;case sr:return L;case cr:return Z}return t});function Gr(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 Ur(e){return typeof e.constructor=="function"&&!ct(e)?Vr(Yt(e)):{}}function qr(e,t,r,n){var i=e.constructor;switch(t){case We:return se(e);case Ae:case Te:return new i(+e);case J:return Nr(e,n);case Ie:case Ne:case ke:case Le:case Je:case Ke:case Fe:case He:case Re:return Fr(e,n);case k:return kr(e,n,r);case De:case Ce:return new i(e);case Me:return Lr(e);case L:return Jr(e,n,r);case Pe:return Kr(e)}}function zr(e,t){return t=t==null?je:t,!!t&&(typeof e=="number"||Lt.test(e))&&e>-1&&e%1==0&&e<t}function Qr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Xr(e){return!!Xe&&Xe in e}function ct(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||K;return e===r}function j(e){if(e!=null){try{return Ye.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Yr(e){return ie(e,!0,!0)}function ut(e,t){return e===t||e!==e&&t!==t}function Zr(e){return en(e)&&S.call(e,"callee")&&(!er.call(e,"callee")||F.call(e)==Q)}var ce=Array.isArray;function lt(e){return e!=null&&rn(e.length)&&!ft(e)}function en(e){return nn(e)&&lt(e)}var tn=rr||an;function ft(e){var t=B(e)?F.call(e):"";return t==X||t==xe}function rn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=je}function B(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nn(e){return!!e&&typeof e=="object"}function ue(e){return lt(e)?xr(e):Wr(e)}function on(){return[]}function an(){return!1}V.exports=Yr});var le=U((_n,ht)=>{var sn="[object Object]";function cn(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 ln=Function.prototype,yt=Object.prototype,gt=ln.toString,fn=yt.hasOwnProperty,pn=gt.call(Object),yn=yt.toString,gn=un(Object.getPrototypeOf,Object);function hn(e){return!!e&&typeof e=="object"}function dn(e){if(!hn(e)||yn.call(e)!=sn||cn(e))return!1;var t=gn(e);if(t===null)return!0;var r=fn.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&gt.call(r)==pn}ht.exports=dn});var Sn={};Vt(Sn,{compare:()=>he});var A=N(Ee(),1);var G=N(pt(),1),dt=N(le(),1);function bn(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=bn;function bt(e,t){let r={now:!1};function n(i,u,f,l){let o=(0,G.default)(i),a,s=m({depth:-1,path:""},f);if(s.depth+=1,Array.isArray(o))for(let c=0,g=o.length;c<g&&!l.now;c++){let h=s.path?`${s.path}.${c}`:`${c}`;o[c]!==void 0?(s.parent=(0,G.default)(o),s.parentType="array",s.parentKey=fe(h),a=n(u(o[c],void 0,C(m({},s),{path:h}),l),u,C(m({},s),{path:h}),l),Number.isNaN(a)&&c<o.length?(o.splice(c,1),c-=1):o[c]=a):o.splice(c,1)}else if((0,dt.default)(o))for(let c in o){if(l.now&&c!=null)break;let g=s.path?`${s.path}.${c}`:c;s.depth===0&&c!=null&&(s.topmostKey=c),s.parent=(0,G.default)(o),s.parentType="object",s.parentKey=fe(g),a=n(u(c,o[c],C(m({},s),{path:g}),l),u,C(m({},s),{path:g}),l),Number.isNaN(a)?delete o[c]:o[c]=a}return o}return n(e,t,{},r)}function b(e){if(typeof e=="string")return!e.trim();if(!["object","string"].includes(typeof e)||!e)return!1;let t=!0;return e=bt(e,(r,n,i,u)=>{let f=n!==void 0?n:r;return typeof f=="string"&&f.trim()&&(t=!1,u.now=!0),f}),t}var w=N(le(),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,mt=(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=="undefined")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})},mn=(e,t)=>{t=m({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 i=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return i.negated=n,ye.set(r,i),i},On=(e,t,r,n)=>{if(e=mt(e,"inputs"),t=mt(t,"patterns"),t.length===0)return[];t=t.map(f=>mn(f,r));let{allPatterns:i}=r||{},u=[];for(let f of e){let l,o=[...t].fill(!1);for(let[a,s]of t.entries())if(s.test(f)&&(o[a]=!0,l=!s.negated,!l))break;if(!(l===!1||l===void 0&&t.some(a=>!a.negated)||i&&o.some((a,s)=>!a&&!t[s].negated))&&(u.push(f),n))break}return u};function ge(e,t,r){return On(e,t,r,!0).length>0}function vn(e){return(0,w.default)(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}function he(e,t,r){let n,i,u,f=0,o=m(m({},{hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1}),r);if(o.hungryForWhitespace&&o.matchStrictly&&(0,w.default)(e)&&b(e)&&(0,w.default)(t)&&!Object.keys(t).length)return!0;if((!o.hungryForWhitespace||o.hungryForWhitespace&&!b(e)&&b(t))&&(0,w.default)(e)&&Object.keys(e).length!==0&&(0,w.default)(t)&&Object.keys(t).length===0||(0,A.default)(e)!==(0,A.default)(t)&&(!o.hungryForWhitespace||o.hungryForWhitespace&&!b(e)))return!1;if(typeof e=="string"&&typeof t=="string")return o.hungryForWhitespace&&b(e)&&b(t)?!0:o.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:o.useWildcards?ge(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(o.hungryForWhitespace&&b(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 a=0,s=t.length;a<s;a++){u=!1;for(let c=f,g=e.length;c<g;c++)if(f+=1,he(e[c],t[a],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((0,w.default)(e)&&(0,w.default)(t)){if(n=new Set(Object.keys(t)),i=new Set(Object.keys(e)),o.matchStrictly&&n.size!==i.size){if(!o.verboseWhenMismatches)return!1;let a=new Set([...n].filter(h=>!i.has(h))),s=a.size?` First object has unique keys: ${JSON.stringify(a,null,4)}.`:"",c=new Set([...i].filter(h=>!n.has(h))),g=c.size?` Second object has unique keys:
11
- ${JSON.stringify(c,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${s}${g}`}for(let a of n){if(!Object.prototype.hasOwnProperty.call(e,a))return!o.useWildcards||o.useWildcards&&!a.includes("*")?o.verboseWhenMismatches?`The given object has key "${a}" which the other-one does not have.`:!1:Object.keys(e).some(s=>ge(s,a,{caseSensitive:!0}))?!0:o.verboseWhenMismatches?`The given object has key "${a}" which the other-one does not have.`:!1;if(e[a]!=null&&(0,A.default)(e[a])!==(0,A.default)(t[a])){if(!(b(e[a])&&b(t[a])&&o.hungryForWhitespace))return o.verboseWhenMismatches?`The given key ${a} is of a different type on both objects. On the first-one, it's ${(0,A.default)(t[a])}, on the second-one, it's ${(0,A.default)(e[a])}`:!1}else if(he(e[a],t[a],o)!==!0)return o.verboseWhenMismatches?`The given piece ${JSON.stringify(t[a],null,4)} and ${JSON.stringify(e[a],null,4)} don't match.`:!1}}else return o.hungryForWhitespace&&b(e)&&b(t)&&(!o.matchStrictly||o.matchStrictly&&vn(t))?!0:e===t;return!0}return Mt(Sn);})();
10
+ var astCompare=(()=>{var _t=Object.create;var M=Object.defineProperty,$t=Object.defineProperties,xt=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)=>$t(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 i of Tt(t))!Se.call(e,i)&&i!==r&&M(e,i,{get:()=>t[i],enumerable:!(n=xt(t,i))||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 Ee=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",i=typeof Set<"u",c=typeof WeakMap<"u",u=typeof WeakSet<"u",o=typeof DataView<"u",a=r&&typeof Symbol.iterator<"u",f=r&&typeof Symbol.toStringTag<"u",s=i&&typeof Set.prototype.entries=="function",l=n&&typeof Map.prototype.entries=="function",h=s&&Object.getPrototypeOf(new Set().entries()),m=l&&Object.getPrototypeOf(new Map().entries()),E=a&&typeof Array.prototype[Symbol.iterator]=="function",Ot=E&&Object.getPrototypeOf([][Symbol.iterator]()),de=a&&typeof String.prototype[Symbol.iterator]=="function",St=de&&Object.getPrototypeOf(""[Symbol.iterator]()),wt=8,Et=-1;function jt(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":i&&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":i&&g===h?"Set Iterator":E&&g===Ot?"Array Iterator":de&&g===St?"String Iterator":g===null?"Object":Object.prototype.toString.call(y).slice(wt,Et)}return jt})});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]",ae="[object Object]",je="[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[ae]=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,i=e.length;++r<n;)e[i+r]=t[r];return e}function tt(e,t,r,n){var i=-1,c=e?e.length:0;for(n&&c&&(r=e[++i]);++i<c;)r=t(r,e[i],i,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 $e(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function ie(e,t){return function(r){return e(t(r))}}function xe(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=ie(Object.getPrototypeOf,Object),er=Object.create,tr=K.propertyIsEnumerable,rr=Qt.splice,Me=Object.getOwnPropertySymbols,nr=Te?Te.isBuffer:void 0,or=ie(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"),ar=$(Y),ir=$(W),sr=$(Z),cr=$(ee),lr=$(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 Er(e){return H(this,e).has(e)}function jr(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=Er;T.prototype.set=jr;function D(e){this.__data__=new O(e)}function _r(){this.__data__=new O}function $r(e){return this.__data__.delete(e)}function xr(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=$r;D.prototype.get=xr;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,i=!!n;for(var c in e)(t||S.call(e,c))&&!(i&&(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&&at(t,le(t),e)}function re(e,t,r,n,i,c,u){var o;if(n&&(o=c?n(e,i,c,u):n(e)),o!==void 0)return o;if(!B(e))return e;var a=ce(e);if(a){if(o=Ur(e),!t)return Hr(e,o)}else{var f=j(e),s=f==oe||f==Le;if(rn(e))return Nr(e,t);if(f==ae||f==ne||s&&!c){if(rt(e))return c?e:{};if(o=qr(s?{}: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),!a)var h=r?Gr(e):le(e);return Gt(h||e,function(m,E){h&&(E=m,m=e[E]),ot(o,E,re(m,t,r,n,E,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($(e))}function Ir(e){if(!st(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 se(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function kr(e,t){var r=t?se(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Lr(e,t,r){var n=t?r($e(e),!0):$e(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(xe(e),!0):xe(e);return tt(n,Bt,new e.constructor)}function Fr(e){return Pe?Object(Pe.call(e)):{}}function Rr(e,t){var r=t?se(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 at(e,t,r,n){r||(r={});for(var i=-1,c=t.length;++i<c;){var u=t[i],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 at(e,it(e),t)}function Gr(e){return Cr(e,le,it)}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 it=Me?ie(Me,Object):an,j=Pr;(Y&&j(new Y(new ArrayBuffer(1)))!=J||W&&j(new W)!=k||Z&&j(Z.resolve())!=je||ee&&j(new ee)!=L||te&&j(new te)!=X)&&(j=function(e){var t=F.call(e),r=t==ae?e.constructor:void 0,n=r?$(r):void 0;if(n)switch(n){case ar:return J;case ir:return k;case sr:return je;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"&&!st(e)?Mr(Zt(e)):{}}function zr(e,t,r,n){var i=e.constructor;switch(t){case He:return se(e);case Ne:case ke:return new i(+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 i(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 st(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||K;return e===r}function $(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)&&lt(e)}var rn=nr||sn;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 an(){return[]}function sn(){return!1}A.exports=Zr});var ue=U(($n,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 jn={};Mt(jn,{compare:()=>ge,defaults:()=>vt,version:()=>wn});var x=N(Ee(),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(i,c,u,o){let a=(0,G.default)(i),f,s=b({depth:-1,path:""},u);if(s.depth+=1,Array.isArray(a))for(let l=0,h=a.length;l<h&&!o.now;l++){let m=s.path?`${s.path}.${l}`:`${l}`;a[l]!==void 0?(s.parent=(0,G.default)(a),s.parentType="array",s.parentKey=fe(m),f=n(c(a[l],void 0,C(b({},s),{path:m}),o),c,C(b({},s),{path:m}),o),Number.isNaN(f)&&l<a.length?(a.splice(l,1),l-=1):a[l]=f):a.splice(l,1)}else if((0,gt.default)(a))for(let l in a){if(o.now&&l!=null)break;let h=s.path?`${s.path}.${l}`:l;s.depth===0&&l!=null&&(s.topmostKey=l),s.parent=(0,G.default)(a),s.parentType="object",s.parentKey=fe(h),f=n(c(l,a[l],C(b({},s),{path:h}),o),c,C(b({},s),{path:h}),o),Number.isNaN(f)?delete a[l]:a[l]=f}return a}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,i,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 i=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return i.negated=n,ye.set(r,i),i},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:i}=r||{},c=[];for(let u of e){let o,a=[...t].fill(!1);for(let[f,s]of t.entries())if(s.test(u)&&(a[f]=!0,o=!s.negated,!o))break;if(!(o===!1||o===void 0&&t.some(f=>!f.negated)||i&&a.some((f,s)=>!f&&!t[s].negated))&&(c.push(u),n))break}return c};function he(e,t,r){return On(e,t,r,!0).length>0}var mt="3.1.0";var wn=mt;function En(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,i,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,x.default)(e)!==(0,x.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 a=0,f=t.length;a<f;a++){c=!1;for(let s=u,l=e.length;s<l;s++)if(u+=1,ge(e[s],t[a],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)),i=new Set(Object.keys(e)),o.matchStrictly&&n.size!==i.size){if(!o.verboseWhenMismatches)return!1;let a=new Set([...n].filter(h=>!i.has(h))),f=a.size?` First object has unique keys: ${JSON.stringify(a,null,4)}.`:"",s=new Set([...i].filter(h=>!n.has(h))),l=s.size?` Second object has unique keys:
11
+ ${JSON.stringify(s,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${f}${l}`}for(let a of n){if(!Object.prototype.hasOwnProperty.call(e,a))return!o.useWildcards||o.useWildcards&&!a.includes("*")?o.verboseWhenMismatches?`The given object has key "${a}" which the other-one does not have.`:!1:Object.keys(e).some(f=>he(f,a,{caseSensitive:!0}))?!0:o.verboseWhenMismatches?`The given object has key "${a}" which the other-one does not have.`:!1;if(e[a]!=null&&(0,x.default)(e[a])!==(0,x.default)(t[a])){if(!(d(e[a])&&d(t[a])&&o.hungryForWhitespace))return o.verboseWhenMismatches?`The given key ${a} is of a different type on both objects. On the first-one, it's ${(0,x.default)(t[a])}, on the second-one, it's ${(0,x.default)(e[a])}`:!1}else if(ge(e[a],t[a],o)!==!0)return o.verboseWhenMismatches?`The given piece ${JSON.stringify(t[a],null,4)} and ${JSON.stringify(e[a],null,4)} don't match.`:!1}}else return o.hungryForWhitespace&&d(e)&&d(t)&&(!o.matchStrictly||o.matchStrictly&&En(t))?!0:e===t;return!0}return Ct(jn);})();
12
12
  /**
13
13
  * @name ast-contains-only-empty-space
14
14
  * @fileoverview Does AST contain only empty space?
15
- * @version 3.0.10
15
+ * @version 3.1.0
16
16
  * @author Roy Revelt, Codsen Ltd
17
17
  * @license MIT
18
18
  * {@link https://codsen.com/os/ast-contains-only-empty-space/}
@@ -20,7 +20,7 @@ var astCompare=(()=>{var Et=Object.create;var M=Object.defineProperty,$t=Object.
20
20
  /**
21
21
  * @name ast-monkey-traverse
22
22
  * @fileoverview Utility library to traverse AST
23
- * @version 3.0.10
23
+ * @version 3.0.12
24
24
  * @author Roy Revelt, Codsen Ltd
25
25
  * @license MIT
26
26
  * {@link https://codsen.com/os/ast-monkey-traverse/}
@@ -28,7 +28,7 @@ var astCompare=(()=>{var Et=Object.create;var M=Object.defineProperty,$t=Object.
28
28
  /**
29
29
  * @name ast-monkey-util
30
30
  * @fileoverview Utility library of AST helper functions
31
- * @version 2.0.10
31
+ * @version 2.0.12
32
32
  * @author Roy Revelt, Codsen Ltd
33
33
  * @license MIT
34
34
  * {@link https://codsen.com/os/ast-monkey-util/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-compare",
3
- "version": "3.0.10",
3
+ "version": "3.1.0",
4
4
  "description": "Compare anything: AST, objects, arrays, strings and nested thereof",
5
5
  "keywords": [
6
6
  "array",
@@ -42,15 +42,18 @@
42
42
  "scripts": {
43
43
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
44
44
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
45
- "dts": "rollup -c",
45
+ "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
46
+ "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
46
47
  "examples": "node '../../ops/scripts/run-examples.js'",
47
- "lect": "node '../../ops/lect/lect.js'",
48
+ "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
48
49
  "letspublish": "yarn publish || :",
49
50
  "lint": "eslint . --fix",
50
51
  "perf": "node perf/check.js",
51
52
  "prepare": "echo 'ready'",
53
+ "prettier": "prettier",
54
+ "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
52
55
  "pretest": "yarn run lect && yarn run build",
53
- "test": "c8 yarn run unit && yarn run examples && yarn run lint",
56
+ "test": "yarn run devtest",
54
57
  "unit": "uvu test"
55
58
  },
56
59
  "engines": {
@@ -71,7 +74,7 @@
71
74
  }
72
75
  },
73
76
  "dependencies": {
74
- "ast-contains-only-empty-space": "^3.0.10",
77
+ "ast-contains-only-empty-space": "^3.1.0",
75
78
  "lodash.isplainobject": "^4.0.6",
76
79
  "matcher": "^5.0.0",
77
80
  "type-detect": "^4.0.8"
@@ -79,6 +82,6 @@
79
82
  "devDependencies": {
80
83
  "@types/lodash.isplainobject": "^4.0.6",
81
84
  "@types/type-detect": "^4.0.1",
82
- "type-fest": "^2.8.0"
85
+ "type-fest": "^2.12.2"
83
86
  }
84
87
  }
package/types/index.d.ts CHANGED
@@ -1,17 +1,29 @@
1
- declare type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
1
+ declare const version: string;
2
+ declare type JsonValue =
3
+ | string
4
+ | number
5
+ | boolean
6
+ | null
7
+ | JsonObject
8
+ | JsonArray;
2
9
  declare type JsonObject = {
3
- [Key in string]?: JsonValue;
10
+ [Key in string]?: JsonValue;
4
11
  };
5
12
  declare type JsonArray = JsonValue[];
6
13
  interface Opts {
7
- hungryForWhitespace?: boolean;
8
- matchStrictly?: boolean;
9
- verboseWhenMismatches?: boolean;
10
- useWildcards?: boolean;
14
+ hungryForWhitespace?: boolean;
15
+ matchStrictly?: boolean;
16
+ verboseWhenMismatches?: boolean;
17
+ useWildcards?: boolean;
11
18
  }
19
+ declare const defaults: Opts;
12
20
  /**
13
21
  * Compare anything: AST, objects, arrays, strings and nested thereof
14
22
  */
15
- declare function compare(b: JsonValue, s: JsonValue, originalOpts?: Opts): boolean | string;
23
+ declare function compare(
24
+ b: JsonValue,
25
+ s: JsonValue,
26
+ originalOpts?: Opts
27
+ ): boolean | string;
16
28
 
17
- export { compare };
29
+ export { compare, defaults, version };