ast-loose-compare 3.1.2 → 3.1.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 CHANGED
@@ -17,7 +17,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
17
17
 
18
18
  ### BREAKING CHANGES
19
19
 
20
- - programs now are in ES Modules and won't work with Common JS require()
20
+ - programs now are in ES Modules and won't work with Common JS `require()`
21
21
 
22
22
  ## 2.1.0 (2021-05-24)
23
23
 
@@ -33,9 +33,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
33
33
 
34
34
  ## 2.0.1 (2021-01-28)
35
35
 
36
- ### Bug Fixes
36
+ ### Fixed
37
37
 
38
- - add testStats to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29))
38
+ - add `testStats` to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29))
39
39
 
40
40
  ## 2.0.0 (2021-01-23)
41
41
 
@@ -49,7 +49,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
49
49
 
50
50
  ## 1.9.0 (2020-11-28)
51
51
 
52
- Accidental version bump during migration to sourcehut. Sorry about that.
52
+ Accidental version bump during migration to SourceHut. Sorry about that.
53
53
 
54
54
  ## 1.8.0 (2020-02-01)
55
55
 
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name ast-loose-compare
3
3
  * @fileoverview Compare anything: AST, objects, arrays and strings
4
- * @version 3.1.2
4
+ * @version 3.1.4
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-loose-compare/}
8
8
  */
9
9
 
10
- import{empty as r}from"ast-contains-only-empty-space";import i from"lodash.isplainobject";var c="3.1.2";var k=c;function p(t,e,s){function a(o){return o!=null}let n,u;if(s===void 0){if(!a(t)||!a(e))return}else if(!a(t)||!a(e))return!1;if(s=s||!0,typeof t!=typeof e)return!!(r(t)&&r(e));if(Array.isArray(t)&&Array.isArray(e))if(e.length){for(n=0,u=e.length;n<u;n++)if(Array.isArray(e[n])||i(e[n])){if(s=p(t[n],e[n],s),!s)return!1}else if(e[n]!==t[n])return!!(r(e[n])&&r(t[n]))}else return!!(e.length===0&&t.length===0||r(e)&&r(t));else if(i(t)&&i(e))if(Object.keys(e).length){let o=Object.keys(e);for(n=0,u=o.length;n<u;n++)if(Array.isArray(e[o[n]])||i(e[o[n]])||typeof e[o[n]]=="string"){if(s=p(t[o[n]],e[o[n]],s),!s)return!1}else if(e[o[n]]!==t[o[n]]&&(!r(e[o[n]])||!r(t[o[n]])))return!1}else return!!(Object.keys(e).length===0&&Object.keys(t).length===0||r(e)&&r(t));else if(typeof t=="string"&&typeof e=="string"){if(t!==e)return!!(r(e)&&r(t))}else return!!(r(e)&&r(t));return s}function V(t,e){return p(t,e)}export{V as looseCompare,k as version};
10
+ import{empty as r}from"ast-contains-only-empty-space";import i from"lodash.isplainobject";var c="3.1.4";var k=c;function p(t,e,s){function a(o){return o!=null}let n,u;if(s===void 0){if(!a(t)||!a(e))return}else if(!a(t)||!a(e))return!1;if(s=s||!0,typeof t!=typeof e)return!!(r(t)&&r(e));if(Array.isArray(t)&&Array.isArray(e))if(e.length){for(n=0,u=e.length;n<u;n++)if(Array.isArray(e[n])||i(e[n])){if(s=p(t[n],e[n],s),!s)return!1}else if(e[n]!==t[n])return!!(r(e[n])&&r(t[n]))}else return!!(e.length===0&&t.length===0||r(e)&&r(t));else if(i(t)&&i(e))if(Object.keys(e).length){let o=Object.keys(e);for(n=0,u=o.length;n<u;n++)if(Array.isArray(e[o[n]])||i(e[o[n]])||typeof e[o[n]]=="string"){if(s=p(t[o[n]],e[o[n]],s),!s)return!1}else if(e[o[n]]!==t[o[n]]&&(!r(e[o[n]])||!r(t[o[n]])))return!1}else return!!(Object.keys(e).length===0&&Object.keys(t).length===0||r(e)&&r(t));else if(typeof t=="string"&&typeof e=="string"){if(t!==e)return!!(r(e)&&r(t))}else return!!(r(e)&&r(t));return s}function V(t,e){return p(t,e)}export{V as looseCompare,k as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name ast-loose-compare
3
3
  * @fileoverview Compare anything: AST, objects, arrays and strings
4
- * @version 3.1.2
4
+ * @version 3.1.4
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-loose-compare/}
8
8
  */
9
9
 
10
- "use strict";var astLooseCompare=(()=>{var ie=Object.create;var j=Object.defineProperty,se=Object.defineProperties,ce=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertyNames,st=Object.getOwnPropertySymbols,le=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable;var ct=(t,e,r)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m=(t,e)=>{for(var r in e||(e={}))ut.call(e,r)&&ct(t,r,e[r]);if(st)for(var r of st(e))pe.call(e,r)&&ct(t,r,e[r]);return t},I=(t,e)=>se(t,ue(e));var ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),de=(t,e)=>{for(var r in e)j(t,r,{get:e[r],enumerable:!0})},lt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of fe(e))!ut.call(t,o)&&o!==r&&j(t,o,{get:()=>e[o],enumerable:!(n=ce(e,o))||n.enumerable});return t};var B=(t,e,r)=>(r=t!=null?ie(le(t)):{},lt(e||!t||!t.__esModule?j(r,"default",{value:t,enumerable:!0}):r,t)),he=t=>lt(j({},"__esModule",{value:!0}),t);var zt=ft((O,A)=>{var ye=200,At="__lodash_hash_undefined__",Tt=9007199254740991,Z="[object Arguments]",ge="[object Array]",St="[object Boolean]",Ct="[object Date]",_e="[object Error]",Q="[object Function]",jt="[object GeneratorFunction]",$="[object Map]",It="[object Number]",z="[object Object]",pt="[object Promise]",Ot="[object RegExp]",k="[object Set]",Et="[object String]",Vt="[object Symbol]",L="[object WeakMap]",Pt="[object ArrayBuffer]",M="[object DataView]",Ut="[object Float32Array]",$t="[object Float64Array]",kt="[object Int8Array]",Mt="[object Int16Array]",Nt="[object Int32Array]",Rt="[object Uint8Array]",Jt="[object Uint8ClampedArray]",Dt="[object Uint16Array]",Gt="[object Uint32Array]",ve=/[\\^$.*+?()[\]{}|]/g,be=/\w*$/,we=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,s={};s[Z]=s[ge]=s[Pt]=s[M]=s[St]=s[Ct]=s[Ut]=s[$t]=s[kt]=s[Mt]=s[Nt]=s[$]=s[It]=s[z]=s[Ot]=s[k]=s[Et]=s[Vt]=s[Rt]=s[Jt]=s[Dt]=s[Gt]=!0;s[_e]=s[Q]=s[L]=!1;var me=typeof global=="object"&&global&&global.Object===Object&&global,Ae=typeof self=="object"&&self&&self.Object===Object&&self,h=me||Ae||Function("return this")(),Kt=typeof O=="object"&&O&&!O.nodeType&&O,dt=Kt&&typeof A=="object"&&A&&!A.nodeType&&A,Te=dt&&dt.exports===Kt;function Se(t,e){return t.set(e[0],e[1]),t}function Ce(t,e){return t.add(e),t}function je(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function Ie(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function Bt(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function Oe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Ee(t,e){return t==null?void 0:t[e]}function Ht(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function ht(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function tt(t,e){return function(r){return t(e(r))}}function yt(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Ve=Array.prototype,Pe=Function.prototype,N=Object.prototype,H=h["__core-js_shared__"],gt=function(){var t=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Lt=Pe.toString,_=N.hasOwnProperty,R=N.toString,Ue=RegExp("^"+Lt.call(_).replace(ve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Te?h.Buffer:void 0,vt=h.Symbol,bt=h.Uint8Array,$e=tt(Object.getPrototypeOf,Object),ke=Object.create,Me=N.propertyIsEnumerable,Ne=Ve.splice,wt=Object.getOwnPropertySymbols,Re=_t?_t.isBuffer:void 0,Je=tt(Object.keys,Object),F=C(h,"DataView"),E=C(h,"Map"),W=C(h,"Promise"),q=C(h,"Set"),X=C(h,"WeakMap"),V=C(Object,"create"),De=x(F),Ge=x(E),Ke=x(W),Be=x(q),He=x(X),xt=vt?vt.prototype:void 0,mt=xt?xt.valueOf:void 0;function w(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Le(){this.__data__=V?V(null):{}}function Fe(t){return this.has(t)&&delete this.__data__[t]}function We(t){var e=this.__data__;if(V){var r=e[t];return r===At?void 0:r}return _.call(e,t)?e[t]:void 0}function qe(t){var e=this.__data__;return V?e[t]!==void 0:_.call(e,t)}function Xe(t,e){var r=this.__data__;return r[t]=V&&e===void 0?At:e,this}w.prototype.clear=Le;w.prototype.delete=Fe;w.prototype.get=We;w.prototype.has=qe;w.prototype.set=Xe;function y(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ye(){this.__data__=[]}function Ze(t){var e=this.__data__,r=J(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ne.call(e,r,1),!0}function Qe(t){var e=this.__data__,r=J(e,t);return r<0?void 0:e[r][1]}function ze(t){return J(this.__data__,t)>-1}function tr(t,e){var r=this.__data__,n=J(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}y.prototype.clear=Ye;y.prototype.delete=Ze;y.prototype.get=Qe;y.prototype.has=ze;y.prototype.set=tr;function T(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function er(){this.__data__={hash:new w,map:new(E||y),string:new w}}function rr(t){return D(this,t).delete(t)}function nr(t){return D(this,t).get(t)}function or(t){return D(this,t).has(t)}function ar(t,e){return D(this,t).set(t,e),this}T.prototype.clear=er;T.prototype.delete=rr;T.prototype.get=nr;T.prototype.has=or;T.prototype.set=ar;function S(t){this.__data__=new y(t)}function ir(){this.__data__=new y}function sr(t){return this.__data__.delete(t)}function cr(t){return this.__data__.get(t)}function ur(t){return this.__data__.has(t)}function fr(t,e){var r=this.__data__;if(r instanceof y){var n=r.__data__;if(!E||n.length<ye-1)return n.push([t,e]),this;r=this.__data__=new T(n)}return r.set(t,e),this}S.prototype.clear=ir;S.prototype.delete=sr;S.prototype.get=cr;S.prototype.has=ur;S.prototype.set=fr;function lr(t,e){var r=rt(t)||kr(t)?Oe(t.length,String):[],n=r.length,o=!!n;for(var i in t)(e||_.call(t,i))&&!(o&&(i=="length"||Vr(i,n)))&&r.push(i);return r}function Ft(t,e,r){var n=t[e];(!(_.call(t,e)&&Yt(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}function J(t,e){for(var r=t.length;r--;)if(Yt(t[r][0],e))return r;return-1}function pr(t,e){return t&&Wt(e,nt(e),t)}function Y(t,e,r,n,o,i,a){var u;if(n&&(u=i?n(t,o,i,a):n(t)),u!==void 0)return u;if(!G(t))return t;var l=rt(t);if(l){if(u=Ir(t),!e)return Sr(t,u)}else{var d=b(t),f=d==Q||d==jt;if(Nr(t))return vr(t,e);if(d==z||d==Z||f&&!i){if(Ht(t))return i?t:{};if(u=Or(f?{}:t),!e)return Cr(t,pr(u,t))}else{if(!s[d])return i?t:{};u=Er(t,d,Y,e)}}a||(a=new S);var c=a.get(t);if(c)return c;if(a.set(t,u),!l)var g=r?jr(t):nt(t);return je(g||t,function(v,U){g&&(U=v,v=t[U]),Ft(u,U,Y(v,e,r,n,U,t,a))}),u}function dr(t){return G(t)?ke(t):{}}function hr(t,e,r){var n=e(t);return rt(t)?n:Ie(n,r(t))}function yr(t){return R.call(t)}function gr(t){if(!G(t)||Ur(t))return!1;var e=Qt(t)||Ht(t)?Ue:we;return e.test(x(t))}function _r(t){if(!Xt(t))return Je(t);var e=[];for(var r in Object(t))_.call(t,r)&&r!="constructor"&&e.push(r);return e}function vr(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function et(t){var e=new t.constructor(t.byteLength);return new bt(e).set(new bt(t)),e}function br(t,e){var r=e?et(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function wr(t,e,r){var n=e?r(ht(t),!0):ht(t);return Bt(n,Se,new t.constructor)}function xr(t){var e=new t.constructor(t.source,be.exec(t));return e.lastIndex=t.lastIndex,e}function mr(t,e,r){var n=e?r(yt(t),!0):yt(t);return Bt(n,Ce,new t.constructor)}function Ar(t){return mt?Object(mt.call(t)):{}}function Tr(t,e){var r=e?et(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Sr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Wt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;Ft(r,a,u===void 0?t[a]:u)}return r}function Cr(t,e){return Wt(t,qt(t),e)}function jr(t){return hr(t,nt,qt)}function D(t,e){var r=t.__data__;return Pr(e)?r[typeof e=="string"?"string":"hash"]:r.map}function C(t,e){var r=Ee(t,e);return gr(r)?r:void 0}var qt=wt?tt(wt,Object):Dr,b=yr;(F&&b(new F(new ArrayBuffer(1)))!=M||E&&b(new E)!=$||W&&b(W.resolve())!=pt||q&&b(new q)!=k||X&&b(new X)!=L)&&(b=function(t){var e=R.call(t),r=e==z?t.constructor:void 0,n=r?x(r):void 0;if(n)switch(n){case De:return M;case Ge:return $;case Ke:return pt;case Be:return k;case He:return L}return e});function Ir(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&_.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Or(t){return typeof t.constructor=="function"&&!Xt(t)?dr($e(t)):{}}function Er(t,e,r,n){var o=t.constructor;switch(e){case Pt:return et(t);case St:case Ct:return new o(+t);case M:return br(t,n);case Ut:case $t:case kt:case Mt:case Nt:case Rt:case Jt:case Dt:case Gt:return Tr(t,n);case $:return wr(t,n,r);case It:case Et:return new o(t);case Ot:return xr(t);case k:return mr(t,n,r);case Vt:return Ar(t)}}function Vr(t,e){return e=e==null?Tt:e,!!e&&(typeof t=="number"||xe.test(t))&&t>-1&&t%1==0&&t<e}function Pr(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ur(t){return!!gt&&gt in t}function Xt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||N;return t===r}function x(t){if(t!=null){try{return Lt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function $r(t){return Y(t,!0,!0)}function Yt(t,e){return t===e||t!==t&&e!==e}function kr(t){return Mr(t)&&_.call(t,"callee")&&(!Me.call(t,"callee")||R.call(t)==Z)}var rt=Array.isArray;function Zt(t){return t!=null&&Rr(t.length)&&!Qt(t)}function Mr(t){return Jr(t)&&Zt(t)}var Nr=Re||Gr;function Qt(t){var e=G(t)?R.call(t):"";return e==Q||e==jt}function Rr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Tt}function G(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Jr(t){return!!t&&typeof t=="object"}function nt(t){return Zt(t)?lr(t):_r(t)}function Dr(){return[]}function Gr(){return!1}A.exports=$r});var ot=ft((on,re)=>{var Kr="[object Object]";function Br(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Hr(t,e){return function(r){return t(e(r))}}var Lr=Function.prototype,te=Object.prototype,ee=Lr.toString,Fr=te.hasOwnProperty,Wr=ee.call(Object),qr=te.toString,Xr=Hr(Object.getPrototypeOf,Object);function Yr(t){return!!t&&typeof t=="object"}function Zr(t){if(!Yr(t)||qr.call(t)!=Kr||Br(t))return!1;var e=Xr(t);if(e===null)return!0;var r=Fr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ee.call(r)==Wr}re.exports=Zr});var rn={};de(rn,{looseCompare:()=>en,version:()=>tn});var K=B(zt(),1),ne=B(ot(),1);function Qr(t){if(t.includes(".")){let e=t.lastIndexOf(".");if(!t.slice(0,e).includes("."))return t.slice(0,e);for(let r=e-1;r--;)if(t[r]===".")return t.slice(r+1,e)}return null}var at=Qr;function oe(t,e){let r={now:!1};function n(o,i,a,u){let l=(0,K.default)(o),d,f=m({depth:-1,path:""},a);if(f.depth+=1,Array.isArray(l))for(let c=0,g=l.length;c<g&&!u.now;c++){let v=f.path?`${f.path}.${c}`:`${c}`;l[c]!==void 0?(f.parent=(0,K.default)(l),f.parentType="array",f.parentKey=at(v),d=n(i(l[c],void 0,I(m({},f),{path:v}),u),i,I(m({},f),{path:v}),u),Number.isNaN(d)&&c<l.length?(l.splice(c,1),c-=1):l[c]=d):l.splice(c,1)}else if((0,ne.default)(l))for(let c in l){if(u.now&&c!=null)break;let g=f.path?`${f.path}.${c}`:c;f.depth===0&&c!=null&&(f.topmostKey=c),f.parent=(0,K.default)(l),f.parentType="object",f.parentKey=at(g),d=n(i(c,l[c],I(m({},f),{path:g}),u),i,I(m({},f),{path:g}),u),Number.isNaN(d)?delete l[c]:l[c]=d}return l}return n(t,e,{},r)}function p(t){if(typeof t=="string")return!t.trim();if(!["object","string"].includes(typeof t)||!t)return!1;let e=!0;return t=oe(t,(r,n,o,i)=>{let a=n!==void 0?n:r;return typeof a=="string"&&a.trim()&&(e=!1,i.now=!0),a}),e}var P=B(ot(),1);var ae="3.1.2";var tn=ae;function it(t,e,r){function n(a){return a!=null}let o,i;if(r===void 0){if(!n(t)||!n(e))return}else if(!n(t)||!n(e))return!1;if(r=r||!0,typeof t!=typeof e)return!!(p(t)&&p(e));if(Array.isArray(t)&&Array.isArray(e))if(e.length){for(o=0,i=e.length;o<i;o++)if(Array.isArray(e[o])||(0,P.default)(e[o])){if(r=it(t[o],e[o],r),!r)return!1}else if(e[o]!==t[o])return!!(p(e[o])&&p(t[o]))}else return!!(e.length===0&&t.length===0||p(e)&&p(t));else if((0,P.default)(t)&&(0,P.default)(e))if(Object.keys(e).length){let a=Object.keys(e);for(o=0,i=a.length;o<i;o++)if(Array.isArray(e[a[o]])||(0,P.default)(e[a[o]])||typeof e[a[o]]=="string"){if(r=it(t[a[o]],e[a[o]],r),!r)return!1}else if(e[a[o]]!==t[a[o]]&&(!p(e[a[o]])||!p(t[a[o]])))return!1}else return!!(Object.keys(e).length===0&&Object.keys(t).length===0||p(e)&&p(t));else if(typeof t=="string"&&typeof e=="string"){if(t!==e)return!!(p(e)&&p(t))}else return!!(p(e)&&p(t));return r}function en(t,e){return it(t,e)}return he(rn);})();
10
+ "use strict";var astLooseCompare=(()=>{var ie=Object.create;var j=Object.defineProperty,se=Object.defineProperties,ce=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertyNames,st=Object.getOwnPropertySymbols,le=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable;var ct=(t,e,r)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m=(t,e)=>{for(var r in e||(e={}))ut.call(e,r)&&ct(t,r,e[r]);if(st)for(var r of st(e))pe.call(e,r)&&ct(t,r,e[r]);return t},I=(t,e)=>se(t,ue(e));var ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),de=(t,e)=>{for(var r in e)j(t,r,{get:e[r],enumerable:!0})},lt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of fe(e))!ut.call(t,o)&&o!==r&&j(t,o,{get:()=>e[o],enumerable:!(n=ce(e,o))||n.enumerable});return t};var B=(t,e,r)=>(r=t!=null?ie(le(t)):{},lt(e||!t||!t.__esModule?j(r,"default",{value:t,enumerable:!0}):r,t)),he=t=>lt(j({},"__esModule",{value:!0}),t);var zt=ft((O,A)=>{var ye=200,At="__lodash_hash_undefined__",Tt=9007199254740991,Z="[object Arguments]",ge="[object Array]",St="[object Boolean]",Ct="[object Date]",_e="[object Error]",Q="[object Function]",jt="[object GeneratorFunction]",$="[object Map]",It="[object Number]",z="[object Object]",pt="[object Promise]",Ot="[object RegExp]",k="[object Set]",Et="[object String]",Vt="[object Symbol]",L="[object WeakMap]",Pt="[object ArrayBuffer]",M="[object DataView]",Ut="[object Float32Array]",$t="[object Float64Array]",kt="[object Int8Array]",Mt="[object Int16Array]",Nt="[object Int32Array]",Rt="[object Uint8Array]",Jt="[object Uint8ClampedArray]",Dt="[object Uint16Array]",Gt="[object Uint32Array]",ve=/[\\^$.*+?()[\]{}|]/g,be=/\w*$/,we=/^\[object .+?Constructor\]$/,xe=/^(?:0|[1-9]\d*)$/,s={};s[Z]=s[ge]=s[Pt]=s[M]=s[St]=s[Ct]=s[Ut]=s[$t]=s[kt]=s[Mt]=s[Nt]=s[$]=s[It]=s[z]=s[Ot]=s[k]=s[Et]=s[Vt]=s[Rt]=s[Jt]=s[Dt]=s[Gt]=!0;s[_e]=s[Q]=s[L]=!1;var me=typeof global=="object"&&global&&global.Object===Object&&global,Ae=typeof self=="object"&&self&&self.Object===Object&&self,h=me||Ae||Function("return this")(),Kt=typeof O=="object"&&O&&!O.nodeType&&O,dt=Kt&&typeof A=="object"&&A&&!A.nodeType&&A,Te=dt&&dt.exports===Kt;function Se(t,e){return t.set(e[0],e[1]),t}function Ce(t,e){return t.add(e),t}function je(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function Ie(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function Bt(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function Oe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Ee(t,e){return t==null?void 0:t[e]}function Ht(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function ht(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function tt(t,e){return function(r){return t(e(r))}}function yt(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Ve=Array.prototype,Pe=Function.prototype,N=Object.prototype,H=h["__core-js_shared__"],gt=function(){var t=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Lt=Pe.toString,_=N.hasOwnProperty,R=N.toString,Ue=RegExp("^"+Lt.call(_).replace(ve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Te?h.Buffer:void 0,vt=h.Symbol,bt=h.Uint8Array,$e=tt(Object.getPrototypeOf,Object),ke=Object.create,Me=N.propertyIsEnumerable,Ne=Ve.splice,wt=Object.getOwnPropertySymbols,Re=_t?_t.isBuffer:void 0,Je=tt(Object.keys,Object),F=C(h,"DataView"),E=C(h,"Map"),W=C(h,"Promise"),q=C(h,"Set"),X=C(h,"WeakMap"),V=C(Object,"create"),De=x(F),Ge=x(E),Ke=x(W),Be=x(q),He=x(X),xt=vt?vt.prototype:void 0,mt=xt?xt.valueOf:void 0;function w(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Le(){this.__data__=V?V(null):{}}function Fe(t){return this.has(t)&&delete this.__data__[t]}function We(t){var e=this.__data__;if(V){var r=e[t];return r===At?void 0:r}return _.call(e,t)?e[t]:void 0}function qe(t){var e=this.__data__;return V?e[t]!==void 0:_.call(e,t)}function Xe(t,e){var r=this.__data__;return r[t]=V&&e===void 0?At:e,this}w.prototype.clear=Le;w.prototype.delete=Fe;w.prototype.get=We;w.prototype.has=qe;w.prototype.set=Xe;function y(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ye(){this.__data__=[]}function Ze(t){var e=this.__data__,r=J(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ne.call(e,r,1),!0}function Qe(t){var e=this.__data__,r=J(e,t);return r<0?void 0:e[r][1]}function ze(t){return J(this.__data__,t)>-1}function tr(t,e){var r=this.__data__,n=J(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}y.prototype.clear=Ye;y.prototype.delete=Ze;y.prototype.get=Qe;y.prototype.has=ze;y.prototype.set=tr;function T(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function er(){this.__data__={hash:new w,map:new(E||y),string:new w}}function rr(t){return D(this,t).delete(t)}function nr(t){return D(this,t).get(t)}function or(t){return D(this,t).has(t)}function ar(t,e){return D(this,t).set(t,e),this}T.prototype.clear=er;T.prototype.delete=rr;T.prototype.get=nr;T.prototype.has=or;T.prototype.set=ar;function S(t){this.__data__=new y(t)}function ir(){this.__data__=new y}function sr(t){return this.__data__.delete(t)}function cr(t){return this.__data__.get(t)}function ur(t){return this.__data__.has(t)}function fr(t,e){var r=this.__data__;if(r instanceof y){var n=r.__data__;if(!E||n.length<ye-1)return n.push([t,e]),this;r=this.__data__=new T(n)}return r.set(t,e),this}S.prototype.clear=ir;S.prototype.delete=sr;S.prototype.get=cr;S.prototype.has=ur;S.prototype.set=fr;function lr(t,e){var r=rt(t)||kr(t)?Oe(t.length,String):[],n=r.length,o=!!n;for(var i in t)(e||_.call(t,i))&&!(o&&(i=="length"||Vr(i,n)))&&r.push(i);return r}function Ft(t,e,r){var n=t[e];(!(_.call(t,e)&&Yt(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}function J(t,e){for(var r=t.length;r--;)if(Yt(t[r][0],e))return r;return-1}function pr(t,e){return t&&Wt(e,nt(e),t)}function Y(t,e,r,n,o,i,a){var u;if(n&&(u=i?n(t,o,i,a):n(t)),u!==void 0)return u;if(!G(t))return t;var l=rt(t);if(l){if(u=Ir(t),!e)return Sr(t,u)}else{var d=b(t),f=d==Q||d==jt;if(Nr(t))return vr(t,e);if(d==z||d==Z||f&&!i){if(Ht(t))return i?t:{};if(u=Or(f?{}:t),!e)return Cr(t,pr(u,t))}else{if(!s[d])return i?t:{};u=Er(t,d,Y,e)}}a||(a=new S);var c=a.get(t);if(c)return c;if(a.set(t,u),!l)var g=r?jr(t):nt(t);return je(g||t,function(v,U){g&&(U=v,v=t[U]),Ft(u,U,Y(v,e,r,n,U,t,a))}),u}function dr(t){return G(t)?ke(t):{}}function hr(t,e,r){var n=e(t);return rt(t)?n:Ie(n,r(t))}function yr(t){return R.call(t)}function gr(t){if(!G(t)||Ur(t))return!1;var e=Qt(t)||Ht(t)?Ue:we;return e.test(x(t))}function _r(t){if(!Xt(t))return Je(t);var e=[];for(var r in Object(t))_.call(t,r)&&r!="constructor"&&e.push(r);return e}function vr(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function et(t){var e=new t.constructor(t.byteLength);return new bt(e).set(new bt(t)),e}function br(t,e){var r=e?et(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function wr(t,e,r){var n=e?r(ht(t),!0):ht(t);return Bt(n,Se,new t.constructor)}function xr(t){var e=new t.constructor(t.source,be.exec(t));return e.lastIndex=t.lastIndex,e}function mr(t,e,r){var n=e?r(yt(t),!0):yt(t);return Bt(n,Ce,new t.constructor)}function Ar(t){return mt?Object(mt.call(t)):{}}function Tr(t,e){var r=e?et(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Sr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Wt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;Ft(r,a,u===void 0?t[a]:u)}return r}function Cr(t,e){return Wt(t,qt(t),e)}function jr(t){return hr(t,nt,qt)}function D(t,e){var r=t.__data__;return Pr(e)?r[typeof e=="string"?"string":"hash"]:r.map}function C(t,e){var r=Ee(t,e);return gr(r)?r:void 0}var qt=wt?tt(wt,Object):Dr,b=yr;(F&&b(new F(new ArrayBuffer(1)))!=M||E&&b(new E)!=$||W&&b(W.resolve())!=pt||q&&b(new q)!=k||X&&b(new X)!=L)&&(b=function(t){var e=R.call(t),r=e==z?t.constructor:void 0,n=r?x(r):void 0;if(n)switch(n){case De:return M;case Ge:return $;case Ke:return pt;case Be:return k;case He:return L}return e});function Ir(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&_.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Or(t){return typeof t.constructor=="function"&&!Xt(t)?dr($e(t)):{}}function Er(t,e,r,n){var o=t.constructor;switch(e){case Pt:return et(t);case St:case Ct:return new o(+t);case M:return br(t,n);case Ut:case $t:case kt:case Mt:case Nt:case Rt:case Jt:case Dt:case Gt:return Tr(t,n);case $:return wr(t,n,r);case It:case Et:return new o(t);case Ot:return xr(t);case k:return mr(t,n,r);case Vt:return Ar(t)}}function Vr(t,e){return e=e==null?Tt:e,!!e&&(typeof t=="number"||xe.test(t))&&t>-1&&t%1==0&&t<e}function Pr(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ur(t){return!!gt&&gt in t}function Xt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||N;return t===r}function x(t){if(t!=null){try{return Lt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function $r(t){return Y(t,!0,!0)}function Yt(t,e){return t===e||t!==t&&e!==e}function kr(t){return Mr(t)&&_.call(t,"callee")&&(!Me.call(t,"callee")||R.call(t)==Z)}var rt=Array.isArray;function Zt(t){return t!=null&&Rr(t.length)&&!Qt(t)}function Mr(t){return Jr(t)&&Zt(t)}var Nr=Re||Gr;function Qt(t){var e=G(t)?R.call(t):"";return e==Q||e==jt}function Rr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Tt}function G(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Jr(t){return!!t&&typeof t=="object"}function nt(t){return Zt(t)?lr(t):_r(t)}function Dr(){return[]}function Gr(){return!1}A.exports=$r});var ot=ft((on,re)=>{var Kr="[object Object]";function Br(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Hr(t,e){return function(r){return t(e(r))}}var Lr=Function.prototype,te=Object.prototype,ee=Lr.toString,Fr=te.hasOwnProperty,Wr=ee.call(Object),qr=te.toString,Xr=Hr(Object.getPrototypeOf,Object);function Yr(t){return!!t&&typeof t=="object"}function Zr(t){if(!Yr(t)||qr.call(t)!=Kr||Br(t))return!1;var e=Xr(t);if(e===null)return!0;var r=Fr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ee.call(r)==Wr}re.exports=Zr});var rn={};de(rn,{looseCompare:()=>en,version:()=>tn});var K=B(zt(),1),ne=B(ot(),1);function Qr(t){if(t.includes(".")){let e=t.lastIndexOf(".");if(!t.slice(0,e).includes("."))return t.slice(0,e);for(let r=e-1;r--;)if(t[r]===".")return t.slice(r+1,e)}return null}var at=Qr;function oe(t,e){let r={now:!1};function n(o,i,a,u){let l=(0,K.default)(o),d,f=m({depth:-1,path:""},a);if(f.depth+=1,Array.isArray(l))for(let c=0,g=l.length;c<g&&!u.now;c++){let v=f.path?`${f.path}.${c}`:`${c}`;l[c]!==void 0?(f.parent=(0,K.default)(l),f.parentType="array",f.parentKey=at(v),d=n(i(l[c],void 0,I(m({},f),{path:v}),u),i,I(m({},f),{path:v}),u),Number.isNaN(d)&&c<l.length?(l.splice(c,1),c-=1):l[c]=d):l.splice(c,1)}else if((0,ne.default)(l))for(let c in l){if(u.now&&c!=null)break;let g=f.path?`${f.path}.${c}`:c;f.depth===0&&c!=null&&(f.topmostKey=c),f.parent=(0,K.default)(l),f.parentType="object",f.parentKey=at(g),d=n(i(c,l[c],I(m({},f),{path:g}),u),i,I(m({},f),{path:g}),u),Number.isNaN(d)?delete l[c]:l[c]=d}return l}return n(t,e,{},r)}function p(t){if(typeof t=="string")return!t.trim();if(!["object","string"].includes(typeof t)||!t)return!1;let e=!0;return t=oe(t,(r,n,o,i)=>{let a=n!==void 0?n:r;return typeof a=="string"&&a.trim()&&(e=!1,i.now=!0),a}),e}var P=B(ot(),1);var ae="3.1.4";var tn=ae;function it(t,e,r){function n(a){return a!=null}let o,i;if(r===void 0){if(!n(t)||!n(e))return}else if(!n(t)||!n(e))return!1;if(r=r||!0,typeof t!=typeof e)return!!(p(t)&&p(e));if(Array.isArray(t)&&Array.isArray(e))if(e.length){for(o=0,i=e.length;o<i;o++)if(Array.isArray(e[o])||(0,P.default)(e[o])){if(r=it(t[o],e[o],r),!r)return!1}else if(e[o]!==t[o])return!!(p(e[o])&&p(t[o]))}else return!!(e.length===0&&t.length===0||p(e)&&p(t));else if((0,P.default)(t)&&(0,P.default)(e))if(Object.keys(e).length){let a=Object.keys(e);for(o=0,i=a.length;o<i;o++)if(Array.isArray(e[a[o]])||(0,P.default)(e[a[o]])||typeof e[a[o]]=="string"){if(r=it(t[a[o]],e[a[o]],r),!r)return!1}else if(e[a[o]]!==t[a[o]]&&(!p(e[a[o]])||!p(t[a[o]])))return!1}else return!!(Object.keys(e).length===0&&Object.keys(t).length===0||p(e)&&p(t));else if(typeof t=="string"&&typeof e=="string"){if(t!==e)return!!(p(e)&&p(t))}else return!!(p(e)&&p(t));return r}function en(t,e){return it(t,e)}return he(rn);})();
11
11
  /**
12
12
  * @name ast-contains-only-empty-space
13
13
  * @fileoverview Does AST contain only empty space?
14
- * @version 3.2.2
14
+ * @version 3.2.4
15
15
  * @author Roy Revelt, Codsen Ltd
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/ast-contains-only-empty-space/}
@@ -19,7 +19,7 @@
19
19
  /**
20
20
  * @name ast-monkey-traverse
21
21
  * @fileoverview Utility library to traverse AST
22
- * @version 3.1.2
22
+ * @version 3.1.4
23
23
  * @author Roy Revelt, Codsen Ltd
24
24
  * @license MIT
25
25
  * {@link https://codsen.com/os/ast-monkey-traverse/}
@@ -27,7 +27,7 @@
27
27
  /**
28
28
  * @name ast-monkey-util
29
29
  * @fileoverview Utility library of AST helper functions
30
- * @version 2.1.2
30
+ * @version 2.1.4
31
31
  * @author Roy Revelt, Codsen Ltd
32
32
  * @license MIT
33
33
  * {@link https://codsen.com/os/ast-monkey-util/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-loose-compare",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "Compare anything: AST, objects, arrays and strings",
5
5
  "keywords": [
6
6
  "array",
@@ -50,7 +50,7 @@
50
50
  "examples": "node '../../ops/scripts/run-examples.js'",
51
51
  "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
52
52
  "letspublish": "yarn publish || :",
53
- "lint": "eslint . --fix",
53
+ "lint": "eslint . --ext .js --ext .ts --fix",
54
54
  "perf": "node perf/check.js",
55
55
  "prepare": "echo 'ready'",
56
56
  "prettier": "prettier",
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "dependencies": {
80
- "ast-contains-only-empty-space": "^3.2.2",
80
+ "ast-contains-only-empty-space": "^3.2.4",
81
81
  "lodash.isplainobject": "^4.0.6"
82
82
  },
83
83
  "devDependencies": {
@@ -1,25 +0,0 @@
1
- // Quick Take
2
-
3
- import { strict as assert } from "assert";
4
-
5
- import { looseCompare } from "../dist/ast-loose-compare.esm.js";
6
-
7
- assert.equal(
8
- looseCompare(
9
- {
10
- a: {
11
- b: "d",
12
- c: [],
13
- e: "f",
14
- g: "h",
15
- },
16
- },
17
- {
18
- a: {
19
- b: "d",
20
- c: [],
21
- },
22
- }
23
- ),
24
- true
25
- );
@@ -1,29 +0,0 @@
1
- // More Examples
2
-
3
- import { strict as assert } from "assert";
4
-
5
- import { looseCompare } from "../dist/ast-loose-compare.esm.js";
6
-
7
- assert.equal(
8
- looseCompare({ a: "1", b: "2", c: "3" }, { a: "1", b: "2" }),
9
- true
10
- );
11
- // true, because second (smallObj) is subset of (or equal) first (bigObj).
12
-
13
- assert.equal(
14
- looseCompare({ a: "1", b: "2" }, { a: "1", b: "2", c: "3" }),
15
- false
16
- );
17
- // false, because second (smallObj) is not a subset (or equal) to first (bigObj).
18
-
19
- assert.equal(looseCompare(["a", "b", "c"], ["a", "b"]), true);
20
- // true, because second is a subset of first
21
-
22
- assert.equal(looseCompare(["a", "b"], ["a", "b", "c"]), false);
23
- // false, because second is not a subset of first
24
-
25
- assert.equal(looseCompare("aaaaa\nbbbbb", "aaaaa\nbbbbb"), true);
26
- // true, because strings are equal
27
-
28
- assert.equal(looseCompare({ a: "a" }), undefined);
29
- // the second argument is missing
@@ -1,20 +0,0 @@
1
- // Empty Values
2
-
3
- import { strict as assert } from "assert";
4
-
5
- import { looseCompare } from "../dist/ast-loose-compare.esm.js";
6
-
7
- // both values are empty - they trim() to zero-length
8
- assert.equal(
9
- looseCompare(
10
- {
11
- a: "a",
12
- b: "\n \n\n",
13
- },
14
- {
15
- a: "a",
16
- b: "\t\t \t",
17
- }
18
- ),
19
- true
20
- );