ast-compare 4.2.6 → 4.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ast-compare.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-compare
|
|
3
3
|
* @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.7
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-compare/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{createMatcher as B,formatDiagnosticValue as b,hasOwnProp as U,isPlainObject as O,match as L}from"codsen-utils";var K="4.2.6";var oe=K,T=Object.freeze({arrayOrder:"ordered",hungryForWhitespace:!1,matchStrictly:!1,reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,verboseWhenMismatches:!1,useWildcards:!1}),ae=Object.freeze({...T}),G=new Set(Object.keys(T)),S=Object.freeze({caseSensitiveMatch:!0}),j=Object.freeze({matched:!1}),w=Object.freeze({matched:!0});function F(t,a,n,r){return{matched:!1,mismatch:{first:n,path:t,reason:a,second:r}}}function P(t,a){return`${t}[${JSON.stringify(a)}]`}function C(t){return t===null?"null":Array.isArray(t)?"array":O(t)?"plain object":typeof t}function Q(t){return`Mismatch at ${t.path}: ${t.reason} First value is ${b(t.first,4)}; second pattern is ${b(t.second,4)}.`}function X(t,a,n){return t.get(a)?.has(n)===!0}function _(t,a,n){let r=t.get(a);r||(r=new WeakSet,t.set(a,r)),r.add(n)}function Y(t,a,n){t.get(a)?.delete(n)}function $(t){return typeof t=="string"&&t.trim().length===0}function D(t){if(Array.isArray(t)){let a=new Array(t.length);for(let n=0;n<t.length;n++)a[n]=t[n];return a}return Object.keys(t).map(a=>t[a])}function H(t,a){if(!Array.isArray(t)&&!O(t))return $(t);let n=a.get(t);if(n!==void 0)return n;let r=new WeakSet,s=[{allEmpty:!0,children:D(t),index:0,value:t}];r.add(t);let o=!1;for(;s.length;){let e=s[s.length-1];if(!e.allEmpty||e.index===e.children.length){o=e.allEmpty,a.set(e.value,o),r.delete(e.value),s.pop(),s.length&&!o&&(s[s.length-1].allEmpty=!1);continue}let d=e.children[e.index++];if(!Array.isArray(d)&&!O(d)){$(d)||(e.allEmpty=!1);continue}let u=a.get(d);u!==void 0?u||(e.allEmpty=!1):r.has(d)?e.allEmpty=!1:(r.add(d),s.push({allEmpty:!0,children:D(d),index:0,value:d}))}return o}function M(t,a){if(t)try{t(a)}catch{}}function V(){try{let t=Date.now();return Number.isFinite(t)?t:null}catch{return null}}function A(t,a=!1){let{opts:n}=t;if(!n.reportProgressFunc)return;let r=n.reportProgressFuncTo-n.reportProgressFuncFrom,s=t.comparisons+t.candidateComparisons,o=Math.min(.99,s/(s+1e3)),e=a?n.reportProgressFuncTo:Number.isFinite(r)?n.reportProgressFuncFrom+r*o:n.reportProgressFuncFrom*(1-o)+n.reportProgressFuncTo*o;e!==t.lastProgress&&(t.lastProgress=e,M(n.reportProgressFunc,e))}function Z(t){t.comparisons+=1,t.comparisons%1e3===0&&A(t)}function J(t){t.candidateComparisons+=1,t.candidateComparisons%1e3===0&&A(t)}function N(t){let a=new Uint32Array(t.length);for(let n=0;n<t.length;n++)a[n]=t[n];return a}function q(t,a){let n=t.length;if(n===0)return!0;let r=new Int32Array(n),s=new Int32Array(a),o=new Int32Array(n);r.fill(-1),s.fill(-1);let e=0;for(;;){let d=new Int32Array(n),u=0,p=0,f=!1;for(let c=0;c<n;c++)r[c]===-1?(o[c]=0,d[p++]=c):o[c]=-1;for(;u<p;){let c=d[u++];for(let l of t[c]){let m=s[l];m===-1?f=!0:o[m]===-1&&(o[m]=o[c]+1,d[p++]=m)}}if(!f)return e===n;let g=new Int32Array(n);for(let c=0;c<n;c++){if(r[c]!==-1)continue;let l=[c],m=[],k=!1;for(;l.length&&!k;){let x=l.length-1,h=l[x],v=t[h],i=!1;for(;g[h]<v.length;){let y=v[g[h]++],W=s[y];if(W===-1){r[h]=y,s[y]=h;for(let I=x-1;I>=0;I--){let E=l[I],R=m[I];r[E]=R,s[R]=E}k=!0;break}if(o[W]===o[h]+1){m[x]=y,l.push(W),i=!0;break}}!i&&!k&&(o[h]=-1,l.pop(),m.length=Math.max(0,l.length-1))}k&&(e+=1)}if(e===n)return!0}}function ee(t,a,n){let{opts:r}=n,s=[{first:t,kind:"pair",path:"$",second:a}],o=w;for(;s.length;){let e=s.pop();if(e.kind==="release-pair"){Y(n.activePairs,e.first,e.second);continue}if(e.kind==="ordered-array"){e.awaiting&&(e.firstIndex+=1,o.matched&&(e.secondIndex+=1)),e.secondIndex===e.second.length?o=w:e.firstIndex===e.first.length?o=r.verboseWhenMismatches?F(e.path,"the second array is not an ordered subset of the first array.",e.first,e.second):j:(e.awaiting=!0,s.push(e),s.push({first:e.first[e.firstIndex],kind:"pair",path:r.verboseWhenMismatches?`${e.path}[${e.firstIndex}]`:"",second:e.second[e.secondIndex]}));continue}if(e.kind==="exact-object"){if(e.awaiting){if(!o.matched)continue;e.index+=1}if(e.index<e.exactKeys.length){let i=e.exactKeys[e.index];e.awaiting=!0,s.push(e),s.push({first:e.first[i],kind:"pair",path:r.verboseWhenMismatches?P(e.path,i):"",second:e.second[i]})}else e.wildcardKeys.length?s.push({awaiting:!1,adjacency:Array.from({length:e.wildcardKeys.length},()=>[]),first:e.first,firstIndex:0,firstKeys:e.wildcardFirstKeys,keyMatchers:e.wildcardKeys.map(i=>B(i,S)),kind:"object-candidates",path:e.path,second:e.second,secondIndex:0,wildcardKeys:e.wildcardKeys}):o=w;continue}if(e.kind==="array-candidates"){e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),n.matchingEdges+=1),o=w,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.second.length?o=q(e.adjacency,e.first.length)?w:r.verboseWhenMismatches?F(e.path,"the second array has no injective unordered match in the first array.",e.first,e.second):j:e.firstIndex===e.first.length?(e.adjacency[e.secondIndex]=N(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,s.push(e)):(J(n),e.awaiting=!0,s.push(e),s.push({first:e.first[e.firstIndex],kind:"pair",path:r.verboseWhenMismatches?`${e.path}[${e.firstIndex}]`:"",second:e.second[e.secondIndex]}));continue}if(e.kind==="object-candidates"){if(e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),n.matchingEdges+=1),o=w,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.wildcardKeys.length)o=q(e.adjacency,e.firstKeys.length)?w:r.verboseWhenMismatches?F(e.path,"the wildcard properties in the second object have no injective key-and-value match in the first object.",e.first,e.second):j;else if(e.firstIndex===e.firstKeys.length)e.adjacency[e.secondIndex]=N(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,s.push(e);else{J(n);let i=e.firstKeys[e.firstIndex];if(e.keyMatchers[e.secondIndex](i)){let y=e.wildcardKeys[e.secondIndex];e.awaiting=!0,s.push(e),s.push({first:e.first[i],kind:"pair",path:r.verboseWhenMismatches?P(e.path,i):"",second:e.second[y]})}else e.firstIndex+=1,s.push(e)}continue}if(Z(n),e.first===e.second&&(!r.useWildcards||typeof e.first!="string"&&!Array.isArray(e.first)&&!O(e.first))){o=w;continue}if(r.hungryForWhitespace&&H(e.first,n.emptyCache)&&H(e.second,n.emptyCache)){o=w;continue}if(typeof e.first=="string"&&typeof e.second=="string"){o=(r.useWildcards?L(e.first,e.second,S):!1)?w:r.verboseWhenMismatches?F(e.path,"the strings do not match.",e.first,e.second):j;continue}let d=Array.isArray(e.first)&&Array.isArray(e.second),u=O(e.first)&&O(e.second);if(!d&&!u){if(!r.verboseWhenMismatches){o=j;continue}let i=C(e.first)===C(e.second)?"the values are not equal.":`the value types differ (${C(e.first)} versus ${C(e.second)}).`;o=F(e.path,i,e.first,e.second);continue}let p=e.first,f=e.second;if(X(n.activePairs,p,f)){o=w;continue}if(d){let i=e.first,y=e.second;if(r.matchStrictly&&i.length!==y.length||y.length>i.length||y.length===0&&i.length!==0){o=r.verboseWhenMismatches?F(e.path,r.matchStrictly?"strict array matching requires equal lengths.":"the second array cannot be an empty or larger subset of the first array.",e.first,e.second):j;continue}_(n.activePairs,p,f),s.push({first:p,kind:"release-pair",second:f}),r.arrayOrder==="any"?s.push({awaiting:!1,adjacency:Array.from({length:y.length},()=>[]),first:i,firstIndex:0,kind:"array-candidates",path:e.path,second:y,secondIndex:0}):s.push({awaiting:!1,first:i,firstIndex:0,kind:"ordered-array",path:e.path,second:y,secondIndex:0});continue}let g=e.first,c=e.second,l=Object.keys(g),m=Object.keys(c);if(r.matchStrictly&&l.length!==m.length||m.length>l.length||m.length===0&&l.length!==0){o=r.verboseWhenMismatches?F(e.path,r.matchStrictly?"strict object matching requires equal key counts.":"the second object cannot be an empty or larger subset of the first object.",e.first,e.second):j;continue}let k=[],x=[],h;for(let i of m)if(Object.prototype.propertyIsEnumerable.call(g,i))k.push(i);else if(r.useWildcards)x.push(i);else{h=i;break}if(h!==void 0){o=r.verboseWhenMismatches?F(P(e.path,h),`the first object does not have the second object's key ${JSON.stringify(h)}.`,void 0,c[h]):j;continue}let v=x.length?new Set(k):null;_(n.activePairs,p,f),s.push({first:p,kind:"release-pair",second:f}),s.push({awaiting:!1,exactKeys:k,first:g,index:0,kind:"exact-object",path:e.path,second:c,wildcardFirstKeys:v?l.filter(i=>!v.has(i)):[],wildcardKeys:x})}return o}function ie(...t){if(t.length<1)throw new TypeError("ast-compare/compare(): [THROW_ID_01] The first value is missing.");if(t.length<2)throw new TypeError("ast-compare/compare(): [THROW_ID_02] The second pattern is missing.");let[a,n,r]=t,s=te(r),o=s.reportCompletionFunc?V():null,e={activePairs:new WeakMap,candidateComparisons:0,comparisons:0,emptyCache:new WeakMap,lastProgress:void 0,matchingEdges:0,opts:s};M(s.reportProgressFunc,s.reportProgressFuncFrom),e.lastProgress=s.reportProgressFuncFrom;let d=ee(a,n,e);if(A(e,!0),s.reportCompletionFunc){let u=V(),p=o===null||u===null?0:u-o;M(s.reportCompletionFunc,Object.freeze({candidateComparisons:e.candidateComparisons,comparisons:e.comparisons,matchingEdges:e.matchingEdges,timeTakenInMilliseconds:Number.isFinite(p)?Math.max(0,p):0}))}return d.matched?!0:s.verboseWhenMismatches?Q(d.mismatch):!1}function te(t){if(t!=null&&!O(t))throw new TypeError(`ast-compare/compare(): [THROW_ID_03] The third argument must be a plain object, null, or undefined; received ${b(t,4)}.`);let a=t??{},n=Object.keys(a).find(l=>!G.has(l));if(n!==void 0)throw new TypeError(`ast-compare/compare(): [THROW_ID_04] Unknown option ${JSON.stringify(n)}.`);let r=l=>U(a,l)?a[l]:T[l],s=r("arrayOrder");if(s!=="ordered"&&s!=="any")throw new TypeError(`ast-compare/compare(): [THROW_ID_05] opts.arrayOrder must be "ordered" or "any"; received ${b(s,4)}.`);let o=r("hungryForWhitespace");if(typeof o!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_06] opts.hungryForWhitespace must be a Boolean; received ${b(o,4)}.`);let e=r("matchStrictly");if(typeof e!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_07] opts.matchStrictly must be a Boolean; received ${b(e,4)}.`);let d=r("verboseWhenMismatches");if(typeof d!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_08] opts.verboseWhenMismatches must be a Boolean; received ${b(d,4)}.`);let u=r("useWildcards");if(typeof u!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_09] opts.useWildcards must be a Boolean; received ${b(u,4)}.`);let p=r("reportCompletionFunc");if(p!==null&&typeof p!="function")throw new TypeError(`ast-compare/compare(): [THROW_ID_10] opts.reportCompletionFunc must be a function or null; received ${b(p,4)}.`);let f=r("reportProgressFunc");if(f!==null&&typeof f!="function")throw new TypeError(`ast-compare/compare(): [THROW_ID_11] opts.reportProgressFunc must be a function or null; received ${b(f,4)}.`);let g=r("reportProgressFuncFrom");if(!Number.isFinite(g))throw new TypeError(`ast-compare/compare(): [THROW_ID_12] opts.reportProgressFuncFrom must be a finite number; received ${b(g,4)}.`);let c=r("reportProgressFuncTo");if(!Number.isFinite(c))throw new TypeError(`ast-compare/compare(): [THROW_ID_13] opts.reportProgressFuncTo must be a finite number; received ${b(c,4)}.`);if(g>c)throw new RangeError(`ast-compare/compare(): [THROW_ID_14] opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ${g} and ${c}.`);return{arrayOrder:s,hungryForWhitespace:o,matchStrictly:e,reportCompletionFunc:p,reportProgressFunc:f,reportProgressFuncFrom:g,reportProgressFuncTo:c,verboseWhenMismatches:d,useWildcards:u}}export{ie as compare,ae as defaults,oe as version};
|
|
10
|
+
import{createMatcher as B,formatDiagnosticValue as b,hasOwnProp as U,isPlainObject as O,match as L}from"codsen-utils";var K="4.2.7";var oe=K,T=Object.freeze({arrayOrder:"ordered",hungryForWhitespace:!1,matchStrictly:!1,reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,verboseWhenMismatches:!1,useWildcards:!1}),ae=Object.freeze({...T}),G=new Set(Object.keys(T)),S=Object.freeze({caseSensitiveMatch:!0}),j=Object.freeze({matched:!1}),w=Object.freeze({matched:!0});function F(t,a,n,r){return{matched:!1,mismatch:{first:n,path:t,reason:a,second:r}}}function P(t,a){return`${t}[${JSON.stringify(a)}]`}function C(t){return t===null?"null":Array.isArray(t)?"array":O(t)?"plain object":typeof t}function Q(t){return`Mismatch at ${t.path}: ${t.reason} First value is ${b(t.first,4)}; second pattern is ${b(t.second,4)}.`}function X(t,a,n){return t.get(a)?.has(n)===!0}function _(t,a,n){let r=t.get(a);r||(r=new WeakSet,t.set(a,r)),r.add(n)}function Y(t,a,n){t.get(a)?.delete(n)}function $(t){return typeof t=="string"&&t.trim().length===0}function D(t){if(Array.isArray(t)){let a=new Array(t.length);for(let n=0;n<t.length;n++)a[n]=t[n];return a}return Object.keys(t).map(a=>t[a])}function H(t,a){if(!Array.isArray(t)&&!O(t))return $(t);let n=a.get(t);if(n!==void 0)return n;let r=new WeakSet,s=[{allEmpty:!0,children:D(t),index:0,value:t}];r.add(t);let o=!1;for(;s.length;){let e=s[s.length-1];if(!e.allEmpty||e.index===e.children.length){o=e.allEmpty,a.set(e.value,o),r.delete(e.value),s.pop(),s.length&&!o&&(s[s.length-1].allEmpty=!1);continue}let d=e.children[e.index++];if(!Array.isArray(d)&&!O(d)){$(d)||(e.allEmpty=!1);continue}let u=a.get(d);u!==void 0?u||(e.allEmpty=!1):r.has(d)?e.allEmpty=!1:(r.add(d),s.push({allEmpty:!0,children:D(d),index:0,value:d}))}return o}function M(t,a){if(t)try{t(a)}catch{}}function V(){try{let t=Date.now();return Number.isFinite(t)?t:null}catch{return null}}function A(t,a=!1){let{opts:n}=t;if(!n.reportProgressFunc)return;let r=n.reportProgressFuncTo-n.reportProgressFuncFrom,s=t.comparisons+t.candidateComparisons,o=Math.min(.99,s/(s+1e3)),e=a?n.reportProgressFuncTo:Number.isFinite(r)?n.reportProgressFuncFrom+r*o:n.reportProgressFuncFrom*(1-o)+n.reportProgressFuncTo*o;e!==t.lastProgress&&(t.lastProgress=e,M(n.reportProgressFunc,e))}function Z(t){t.comparisons+=1,t.comparisons%1e3===0&&A(t)}function J(t){t.candidateComparisons+=1,t.candidateComparisons%1e3===0&&A(t)}function N(t){let a=new Uint32Array(t.length);for(let n=0;n<t.length;n++)a[n]=t[n];return a}function q(t,a){let n=t.length;if(n===0)return!0;let r=new Int32Array(n),s=new Int32Array(a),o=new Int32Array(n);r.fill(-1),s.fill(-1);let e=0;for(;;){let d=new Int32Array(n),u=0,p=0,f=!1;for(let c=0;c<n;c++)r[c]===-1?(o[c]=0,d[p++]=c):o[c]=-1;for(;u<p;){let c=d[u++];for(let l of t[c]){let m=s[l];m===-1?f=!0:o[m]===-1&&(o[m]=o[c]+1,d[p++]=m)}}if(!f)return e===n;let g=new Int32Array(n);for(let c=0;c<n;c++){if(r[c]!==-1)continue;let l=[c],m=[],k=!1;for(;l.length&&!k;){let x=l.length-1,h=l[x],v=t[h],i=!1;for(;g[h]<v.length;){let y=v[g[h]++],W=s[y];if(W===-1){r[h]=y,s[y]=h;for(let I=x-1;I>=0;I--){let E=l[I],R=m[I];r[E]=R,s[R]=E}k=!0;break}if(o[W]===o[h]+1){m[x]=y,l.push(W),i=!0;break}}!i&&!k&&(o[h]=-1,l.pop(),m.length=Math.max(0,l.length-1))}k&&(e+=1)}if(e===n)return!0}}function ee(t,a,n){let{opts:r}=n,s=[{first:t,kind:"pair",path:"$",second:a}],o=w;for(;s.length;){let e=s.pop();if(e.kind==="release-pair"){Y(n.activePairs,e.first,e.second);continue}if(e.kind==="ordered-array"){e.awaiting&&(e.firstIndex+=1,o.matched&&(e.secondIndex+=1)),e.secondIndex===e.second.length?o=w:e.firstIndex===e.first.length?o=r.verboseWhenMismatches?F(e.path,"the second array is not an ordered subset of the first array.",e.first,e.second):j:(e.awaiting=!0,s.push(e),s.push({first:e.first[e.firstIndex],kind:"pair",path:r.verboseWhenMismatches?`${e.path}[${e.firstIndex}]`:"",second:e.second[e.secondIndex]}));continue}if(e.kind==="exact-object"){if(e.awaiting){if(!o.matched)continue;e.index+=1}if(e.index<e.exactKeys.length){let i=e.exactKeys[e.index];e.awaiting=!0,s.push(e),s.push({first:e.first[i],kind:"pair",path:r.verboseWhenMismatches?P(e.path,i):"",second:e.second[i]})}else e.wildcardKeys.length?s.push({awaiting:!1,adjacency:Array.from({length:e.wildcardKeys.length},()=>[]),first:e.first,firstIndex:0,firstKeys:e.wildcardFirstKeys,keyMatchers:e.wildcardKeys.map(i=>B(i,S)),kind:"object-candidates",path:e.path,second:e.second,secondIndex:0,wildcardKeys:e.wildcardKeys}):o=w;continue}if(e.kind==="array-candidates"){e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),n.matchingEdges+=1),o=w,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.second.length?o=q(e.adjacency,e.first.length)?w:r.verboseWhenMismatches?F(e.path,"the second array has no injective unordered match in the first array.",e.first,e.second):j:e.firstIndex===e.first.length?(e.adjacency[e.secondIndex]=N(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,s.push(e)):(J(n),e.awaiting=!0,s.push(e),s.push({first:e.first[e.firstIndex],kind:"pair",path:r.verboseWhenMismatches?`${e.path}[${e.firstIndex}]`:"",second:e.second[e.secondIndex]}));continue}if(e.kind==="object-candidates"){if(e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),n.matchingEdges+=1),o=w,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.wildcardKeys.length)o=q(e.adjacency,e.firstKeys.length)?w:r.verboseWhenMismatches?F(e.path,"the wildcard properties in the second object have no injective key-and-value match in the first object.",e.first,e.second):j;else if(e.firstIndex===e.firstKeys.length)e.adjacency[e.secondIndex]=N(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,s.push(e);else{J(n);let i=e.firstKeys[e.firstIndex];if(e.keyMatchers[e.secondIndex](i)){let y=e.wildcardKeys[e.secondIndex];e.awaiting=!0,s.push(e),s.push({first:e.first[i],kind:"pair",path:r.verboseWhenMismatches?P(e.path,i):"",second:e.second[y]})}else e.firstIndex+=1,s.push(e)}continue}if(Z(n),e.first===e.second&&(!r.useWildcards||typeof e.first!="string"&&!Array.isArray(e.first)&&!O(e.first))){o=w;continue}if(r.hungryForWhitespace&&H(e.first,n.emptyCache)&&H(e.second,n.emptyCache)){o=w;continue}if(typeof e.first=="string"&&typeof e.second=="string"){o=(r.useWildcards?L(e.first,e.second,S):!1)?w:r.verboseWhenMismatches?F(e.path,"the strings do not match.",e.first,e.second):j;continue}let d=Array.isArray(e.first)&&Array.isArray(e.second),u=O(e.first)&&O(e.second);if(!d&&!u){if(!r.verboseWhenMismatches){o=j;continue}let i=C(e.first)===C(e.second)?"the values are not equal.":`the value types differ (${C(e.first)} versus ${C(e.second)}).`;o=F(e.path,i,e.first,e.second);continue}let p=e.first,f=e.second;if(X(n.activePairs,p,f)){o=w;continue}if(d){let i=e.first,y=e.second;if(r.matchStrictly&&i.length!==y.length||y.length>i.length||y.length===0&&i.length!==0){o=r.verboseWhenMismatches?F(e.path,r.matchStrictly?"strict array matching requires equal lengths.":"the second array cannot be an empty or larger subset of the first array.",e.first,e.second):j;continue}_(n.activePairs,p,f),s.push({first:p,kind:"release-pair",second:f}),r.arrayOrder==="any"?s.push({awaiting:!1,adjacency:Array.from({length:y.length},()=>[]),first:i,firstIndex:0,kind:"array-candidates",path:e.path,second:y,secondIndex:0}):s.push({awaiting:!1,first:i,firstIndex:0,kind:"ordered-array",path:e.path,second:y,secondIndex:0});continue}let g=e.first,c=e.second,l=Object.keys(g),m=Object.keys(c);if(r.matchStrictly&&l.length!==m.length||m.length>l.length||m.length===0&&l.length!==0){o=r.verboseWhenMismatches?F(e.path,r.matchStrictly?"strict object matching requires equal key counts.":"the second object cannot be an empty or larger subset of the first object.",e.first,e.second):j;continue}let k=[],x=[],h;for(let i of m)if(Object.prototype.propertyIsEnumerable.call(g,i))k.push(i);else if(r.useWildcards)x.push(i);else{h=i;break}if(h!==void 0){o=r.verboseWhenMismatches?F(P(e.path,h),`the first object does not have the second object's key ${JSON.stringify(h)}.`,void 0,c[h]):j;continue}let v=x.length?new Set(k):null;_(n.activePairs,p,f),s.push({first:p,kind:"release-pair",second:f}),s.push({awaiting:!1,exactKeys:k,first:g,index:0,kind:"exact-object",path:e.path,second:c,wildcardFirstKeys:v?l.filter(i=>!v.has(i)):[],wildcardKeys:x})}return o}function ie(...t){if(t.length<1)throw new TypeError("ast-compare/compare(): [THROW_ID_01] The first value is missing.");if(t.length<2)throw new TypeError("ast-compare/compare(): [THROW_ID_02] The second pattern is missing.");let[a,n,r]=t,s=te(r),o=s.reportCompletionFunc?V():null,e={activePairs:new WeakMap,candidateComparisons:0,comparisons:0,emptyCache:new WeakMap,lastProgress:void 0,matchingEdges:0,opts:s};M(s.reportProgressFunc,s.reportProgressFuncFrom),e.lastProgress=s.reportProgressFuncFrom;let d=ee(a,n,e);if(A(e,!0),s.reportCompletionFunc){let u=V(),p=o===null||u===null?0:u-o;M(s.reportCompletionFunc,Object.freeze({candidateComparisons:e.candidateComparisons,comparisons:e.comparisons,matchingEdges:e.matchingEdges,timeTakenInMilliseconds:Number.isFinite(p)?Math.max(0,p):0}))}return d.matched?!0:s.verboseWhenMismatches?Q(d.mismatch):!1}function te(t){if(t!=null&&!O(t))throw new TypeError(`ast-compare/compare(): [THROW_ID_03] The third argument must be a plain object, null, or undefined; received ${b(t,4)}.`);let a=t??{},n=Object.keys(a).find(l=>!G.has(l));if(n!==void 0)throw new TypeError(`ast-compare/compare(): [THROW_ID_04] Unknown option ${JSON.stringify(n)}.`);let r=l=>U(a,l)?a[l]:T[l],s=r("arrayOrder");if(s!=="ordered"&&s!=="any")throw new TypeError(`ast-compare/compare(): [THROW_ID_05] opts.arrayOrder must be "ordered" or "any"; received ${b(s,4)}.`);let o=r("hungryForWhitespace");if(typeof o!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_06] opts.hungryForWhitespace must be a Boolean; received ${b(o,4)}.`);let e=r("matchStrictly");if(typeof e!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_07] opts.matchStrictly must be a Boolean; received ${b(e,4)}.`);let d=r("verboseWhenMismatches");if(typeof d!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_08] opts.verboseWhenMismatches must be a Boolean; received ${b(d,4)}.`);let u=r("useWildcards");if(typeof u!="boolean")throw new TypeError(`ast-compare/compare(): [THROW_ID_09] opts.useWildcards must be a Boolean; received ${b(u,4)}.`);let p=r("reportCompletionFunc");if(p!==null&&typeof p!="function")throw new TypeError(`ast-compare/compare(): [THROW_ID_10] opts.reportCompletionFunc must be a function or null; received ${b(p,4)}.`);let f=r("reportProgressFunc");if(f!==null&&typeof f!="function")throw new TypeError(`ast-compare/compare(): [THROW_ID_11] opts.reportProgressFunc must be a function or null; received ${b(f,4)}.`);let g=r("reportProgressFuncFrom");if(!Number.isFinite(g))throw new TypeError(`ast-compare/compare(): [THROW_ID_12] opts.reportProgressFuncFrom must be a finite number; received ${b(g,4)}.`);let c=r("reportProgressFuncTo");if(!Number.isFinite(c))throw new TypeError(`ast-compare/compare(): [THROW_ID_13] opts.reportProgressFuncTo must be a finite number; received ${b(c,4)}.`);if(g>c)throw new RangeError(`ast-compare/compare(): [THROW_ID_14] opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ${g} and ${c}.`);return{arrayOrder:s,hungryForWhitespace:o,matchStrictly:e,reportCompletionFunc:p,reportProgressFunc:f,reportProgressFuncFrom:g,reportProgressFuncTo:c,verboseWhenMismatches:d,useWildcards:u}}export{ie as compare,ae as defaults,oe as version};
|
package/dist/ast-compare.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-compare
|
|
3
3
|
* @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.7
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-compare/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var astCompare=(()=>{var F=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames,q=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var J=(t,n,r)=>n in t?F(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,G=(t,n)=>{for(var r in n||(n={}))Q.call(n,r)&&J(t,r,n[r]);if(q)for(var r of q(n))je.call(n,r)&&J(t,r,n[r]);return t};var ke=(t,n)=>{for(var r in n)F(t,r,{get:n[r],enumerable:!0})},Oe=(t,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let _ of ve(n))!Q.call(t,_)&&_!==r&&F(t,_,{get:()=>n[_],enumerable:!(s=we(n,_))||s.enumerable});return t};var xe=t=>Oe(F({},"__esModule",{value:!0}),t);var tt={};ke(tt,{compare:()=>Xe,defaults:()=>Ue,version:()=>He});function Ce(){let t=[],n=0,r=!1;return{append(s){return r?!1:n+s.length>1999?(t.push("\u2026"),n+=1,r=!0,!1):(t.push(s),n+=s.length,!0)},result(){return t.join("")},stopped(){return r}}}function Ae(t){return"\\u".concat(t.toString(16).padStart(4,"0"))}function I(t,n){if(t.append('"')){for(let r=0;r<n.length&&!t.stopped();r+=1){let s=n.charCodeAt(r);s===34?t.append('\\"'):s===92?t.append("\\\\"):s===8?t.append("\\b"):s===9?t.append("\\t"):s===10?t.append("\\n"):s===12?t.append("\\f"):s===13?t.append("\\r"):s<32||s===8232||s===8233||s>=55296&&s<=57343?t.append(Ae(s)):t.append(n[r])}t.append('"')}}function Fe(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function Y(t,n){t.append("Symbol(");let r=String(n);r.length>8&&I(t,r.slice(7,-1)),t.append(")")}function Z(t,n){typeof n=="symbol"?Y(t,n):I(t,String(n))}function v(t,n=0){let r=Ce(),s=n===4?4:0,_=new WeakSet,o=0;function e(a){s&&r.append(" ".repeat(a*s))}function i(a,p){a&&r.append(","),s&&(r.append("\n"),e(p+1))}function c(a,p,d){s&&p&&(r.append("\n"),e(d)),r.append(a)}function u(a,p){Object.prototype.hasOwnProperty.call(a,"value")?g(a.value,p):r.append(Fe(a))}function m(a,p){let d;try{d=Reflect.getOwnPropertyDescriptor(a,"length")}catch(l){r.append("[Uninspectable]");return}let h=d==null?void 0:d.value;if(!Number.isSafeInteger(h)||h<0){r.append("[Uninspectable]");return}r.append("[");let w=!1;for(let l=0;l<h&&!r.stopped();l+=1){if(i(w,p),w=!0,o>=50){r.append("[MaxEntries]");break}o+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(a,String(l))}catch(C){r.append("[Uninspectable]");continue}y!=null&&y.enumerable?u(y,p+1):r.append("[Empty]")}c("]",w,p)}function b(a,p){let d;try{d=Reflect.ownKeys(a)}catch(w){r.append("[Uninspectable]");return}r.append("{");let h=!1;for(let w of d){if(r.stopped())break;if(o>=50){i(h,p),h=!0,I(r,"\u2026"),r.append(s?": ":":"),r.append("[MaxEntries]");break}o+=1;let l;try{l=Reflect.getOwnPropertyDescriptor(a,w)}catch(y){i(h,p),h=!0,Z(r,w),r.append(s?": ":":"),r.append("[Uninspectable]");continue}l!=null&&l.enumerable&&(i(h,p),h=!0,Z(r,w),r.append(s?": ":":"),u(l,p+1))}c("}",h,p)}function f(a,p){if(_.has(a)){r.append("[Circular]");return}if(p>=5){r.append("[MaxDepth]");return}let d;try{d=Array.isArray(a)}catch(h){r.append("[Uninspectable]");return}_.add(a);try{d?m(a,p):b(a,p)}finally{_.delete(a)}}function g(a,p){a===null?r.append("null"):typeof a=="string"?I(r,a):typeof a=="number"?r.append(Object.is(a,-0)?"-0":String(a)):typeof a=="boolean"?r.append(a?"true":"false"):typeof a>"u"?r.append("undefined"):typeof a=="bigint"?r.append("".concat(a,"n")):typeof a=="symbol"?Y(r,a):typeof a=="function"?r.append("[Function]"):f(a,p)}try{return g(t,0),r.result()}catch(a){return"[Uninspectable]"}}var Ie=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),S=Ie.slice(1).split("_"),We=[],X=127;for(let t=0;t<S.length;t+=2){let n=X+1+Number.parseInt(S[t],36),r=n+Number.parseInt(S[t+1],36);We.push([n,r]),X=r}var ot=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Pe=Object.prototype.hasOwnProperty,_e=Function.prototype.toString,Me=_e.call(Object);var it=Map.prototype.entries,at=Set.prototype.values;var te,ct=(te=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:te.get,re,lt=(re=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:re.get,ne,ut=(ne=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:ne.get,se,ft=(se=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:se.get,pt=RegExp.prototype.test;function k(t){var s;if(t==null||typeof t!="object")return!1;let n=Object.getPrototypeOf(t);if(n===null||n===Object.prototype)return!0;let r=Object.getOwnPropertyDescriptor(n,"constructor");return!r||!("value"in r)||typeof r.value!="function"?!1:((s=Object.getOwnPropertyDescriptor(r.value,"prototype"))==null?void 0:s.value)===n&&_e.call(r.value)===Me}var dt=Date.prototype.getTime;function oe(t,n){return t!=null&&Pe.call(t,n)}var Se=256,Re=1024,Ee=1,De=new Map,Te=new Map;function D(t){if(t>=97&&t<=122)return t-32;if(t>65535)return t;let n=String.fromCharCode(t).toUpperCase();if(n.length!==1)return t;let r=n.charCodeAt(0);return t>127&&r<128?t:r}function R(t,n,r,s,_,o){for(let e=0;e<_;e++){let i=t.charCodeAt(n+e),c=r.charCodeAt(s+e);if(o||(i>=97&&i<=122&&(i-=32),c>=97&&c<=122&&(c-=32)),i!==c)return!1}return!0}function ie(t,n,r){let s=n.indexOf("\\");if(s===-1&&t===n)return!0;let _=n.indexOf("*");if(s===-1&&_===-1){if(r)return!1;for(let m=0;m<n.length;m++)if(n.charCodeAt(m)>127)return;return t.length===n.length&&R(t,0,n,0,n.length,!1)}if(s!==-1)return;let o=0,e=!1,i=-1;for(let m=0;m<n.length;m++){let b=n.charCodeAt(m);if(b>127)return;if(b===42){if(i=m,!e){if(o++,o>1)return;e=!0}}else e=!1}let c=i+1,u=n.length-c;return t.length<_+u?!1:R(t,0,n,0,_,r)&&R(t,t.length-u,n,c,u,r)}function $e(t){let n=new Uint32Array(t.length),r=0;for(let s=1;s<t.length;s++){for(;r>0&&t[s]!==t[r];)r=n[r-1];t[s]===t[r]&&r++,n[s]=r}return n}function Ke(t,n){let r=[[]],s=!0,_=!1,o=!1,e=0;for(let f=0;f<t.length;){let g=t.codePointAt(f);if(g!==92){if(g===42)_=!0,o||(r.push([]),o=!0);else{let l=n?g:D(g);r[r.length-1].push(l),s&&(s=l<=127),e++,o=!1}f+=g>65535?2:1;continue}let a=f+1;for(;t.charCodeAt(a)===92;)a++;let p=a-f,d=t.codePointAt(a),h,w=!1;d===42?(w=p%2===0,h=w?p/2:(p-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?h=Math.ceil(p/2):h=Math.floor(p/2);for(let l=0;l<h;l++)r[r.length-1].push(92),e++;if(w){o=!1,f=a;continue}if(d!==void 0){let l=n?d:D(d);r[r.length-1].push(l),s&&(s=l<=127),e++,a+=d>65535?2:1}o=!1,f=a}let i=_&&r[0].length===0,c=_&&r[r.length-1].length===0,u=[];for(let f of r)f.length&&u.push({values:f});let m=i?0:1,b=u.length-(c?0:1);for(let f=m;f<b;f++)u[f].values.length>Ee&&(u[f].failure=$e(u[f].values));return{asciiOnly:s,endsWithWildcard:c,hasWildcard:_,minimumInputLength:e,segments:u,startsWithWildcard:i}}function T(t,n){let r=n?De:Te,s=t.length<=Re;if(s){let o=r.get(t);if(o)return o}let _=Ke(t,n);if(s){if(r.size>=Se){let o=r.keys().next().value;o!==void 0&&r.delete(o)}r.set(t,_)}return _}function $(t,n){if(n){let _=[];for(let o=0;o<t.length;){let e=t.codePointAt(o);_.push(e),o+=e>65535?2:1}return _}let r=new Uint32Array(t.length),s=0;for(let _=0;_<t.length;){let o=t.codePointAt(_);r[s]=D(o),s++,_+=o>65535?2:1}return s===r.length?r:r.subarray(0,s)}function W(t,n,r,s){for(let _=0;_<r.values.length;_++){let o=t.charCodeAt(n+_);if(!s&&o>=97&&o<=122&&(o-=32),o!==r.values[_])return!1}return!0}function Be(t,n,r,s,_){let o=s-n.values.length;if(o<r)return-1;if(!n.failure){for(let i=r;i<=o;i++)if(W(t,i,n,_))return i;return-1}let e=0;for(let i=r;i<s;i++){let c=t.charCodeAt(i);for(!_&&c>=97&&c<=122&&(c-=32);e>0&&c!==n.values[e];)e=n.failure[e-1];if(c===n.values[e]&&(e++,e===n.values.length))return i-e+1}return-1}function K(t,n,r){if(t.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return t.length===n.minimumInputLength&&W(t,0,n.segments[0],r);let s=0,_=n.segments.length,o=0,e=t.length;if(!n.startsWithWildcard){let i=n.segments[0];if(!W(t,0,i,r))return!1;o=i.values.length,s++}if(!n.endsWithWildcard){_--;let i=n.segments[_];if(e-=i.values.length,!W(t,e,i,r))return!1}for(let i=s;i<_;i++){let c=n.segments[i],u=Be(t,c,o,e,r);if(u===-1)return!1;o=u+c.values.length}return!0}function P(t,n,r){for(let s=0;s<r.values.length;s++)if(t[n+s]!==r.values[s])return!1;return!0}function Ne(t,n,r,s){let _=s-n.values.length;if(_<r)return-1;if(!n.failure){for(let e=r;e<=_;e++)if(P(t,e,n))return e;return-1}let o=0;for(let e=r;e<s;e++){for(;o>0&&t[e]!==n.values[o];)o=n.failure[o-1];if(t[e]===n.values[o]&&(o++,o===n.values.length))return e-o+1}return-1}function B(t,n){if(t.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return t.length===n.minimumInputLength&&P(t,0,n.segments[0]);let r=0,s=n.segments.length,_=0,o=t.length;if(!n.startsWithWildcard){let e=n.segments[0];if(!P(t,0,e))return!1;_=e.values.length,r++}if(!n.endsWithWildcard){s--;let e=n.segments[s];if(o-=e.values.length,!P(t,o,e))return!1}for(let e=r;e<s;e++){let i=n.segments[e],c=Ne(t,i,_,o);if(c===-1)return!1;_=c+i.values.length}return!0}function ze(t,n,r){let s=ie(t,n,r);if(s!==void 0)return s;let _=T(n,r);return _.asciiOnly?K(t,_,r):B($(t,r),_)}function ee(t,n,r,s){var e;let _=ie(t,n,r);if(_!==void 0)return _;let o=T(n,r);return o.asciiOnly?K(t,o,r):((e=s.tokens)!=null||(s.tokens=$(t,r)),B(s.tokens,o))}function Ve(t,n){let r=t.charCodeAt(0)===33,s=r?t.slice(1):t;return{compiled:s.length===0?void 0:T(s,n),negative:r}}function E(t,n,r,s){var o;let _;return n.compiled?n.compiled.asciiOnly?_=K(t,n.compiled,r):((o=s.tokens)!=null||(s.tokens=$(t,r)),_=B(s.tokens,n.compiled)):_=t.length===0,n.negative?!_:_}function ae(t,n){let r=(n==null?void 0:n.caseSensitiveMatch)===!0,s=typeof t=="string"?[t]:Array.from(new Set(t));if(s.length===0)return()=>!1;let _=s.map(o=>Ve(o,r));if(typeof t=="string"){let o=_[0];return e=>E(e,o,r,{})}return o=>{let e={},i=!1,c=!1;for(let u of _)if(u.negative){if(!E(o,u,r,e))return!1}else i=!0,!c&&E(o,u,r,e)&&(c=!0);return i?c:!0}}function ce(t,n,r){if(typeof n!="string"&&!n.length)return!1;let s=r===void 0?!1:r.caseSensitiveMatch===!0;if(typeof n=="string"){let i=n.charCodeAt(0)===33,c=i?n.slice(1):n,u=ze(t,c,s);return i?!u:u}let _={},o=!1,e=!1;for(let i of n){let c=i.charCodeAt(0)===33,u=c?i.slice(1):i;if(c){if(ee(t,u,s,_))return!1}else o=!0,!e&&ee(t,u,s,_)&&(e=!0)}return o?e:!0}var le="4.2.6";var He=le,V=Object.freeze({arrayOrder:"ordered",hungryForWhitespace:!1,matchStrictly:!1,reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,verboseWhenMismatches:!1,useWildcards:!1}),Ue=Object.freeze(G({},V)),qe=new Set(Object.keys(V)),ue=Object.freeze({caseSensitiveMatch:!0}),O=Object.freeze({matched:!1}),j=Object.freeze({matched:!0});function x(t,n,r,s){return{matched:!1,mismatch:{first:r,path:t,reason:n,second:s}}}function N(t,n){return"".concat(t,"[").concat(JSON.stringify(n),"]")}function M(t){return t===null?"null":Array.isArray(t)?"array":k(t)?"plain object":typeof t}function Je(t){return"Mismatch at ".concat(t.path,": ").concat(t.reason," First value is ").concat(v(t.first,4),"; second pattern is ").concat(v(t.second,4),".")}function Qe(t,n,r){var s;return((s=t.get(n))==null?void 0:s.has(r))===!0}function fe(t,n,r){let s=t.get(n);s||(s=new WeakSet,t.set(n,s)),s.add(r)}function Ge(t,n,r){var s;(s=t.get(n))==null||s.delete(r)}function pe(t){return typeof t=="string"&&t.trim().length===0}function de(t){if(Array.isArray(t)){let n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=t[r];return n}return Object.keys(t).map(n=>t[n])}function he(t,n){if(!Array.isArray(t)&&!k(t))return pe(t);let r=n.get(t);if(r!==void 0)return r;let s=new WeakSet,_=[{allEmpty:!0,children:de(t),index:0,value:t}];s.add(t);let o=!1;for(;_.length;){let e=_[_.length-1];if(!e.allEmpty||e.index===e.children.length){o=e.allEmpty,n.set(e.value,o),s.delete(e.value),_.pop(),_.length&&!o&&(_[_.length-1].allEmpty=!1);continue}let i=e.children[e.index++];if(!Array.isArray(i)&&!k(i)){pe(i)||(e.allEmpty=!1);continue}let c=n.get(i);c!==void 0?c||(e.allEmpty=!1):s.has(i)?e.allEmpty=!1:(s.add(i),_.push({allEmpty:!0,children:de(i),index:0,value:i}))}return o}function z(t,n){if(t)try{t(n)}catch(r){}}function ge(){try{let t=Date.now();return Number.isFinite(t)?t:null}catch(t){return null}}function L(t,n=!1){let{opts:r}=t;if(!r.reportProgressFunc)return;let s=r.reportProgressFuncTo-r.reportProgressFuncFrom,_=t.comparisons+t.candidateComparisons,o=Math.min(.99,_/(_+1e3)),e=n?r.reportProgressFuncTo:Number.isFinite(s)?r.reportProgressFuncFrom+s*o:r.reportProgressFuncFrom*(1-o)+r.reportProgressFuncTo*o;e!==t.lastProgress&&(t.lastProgress=e,z(r.reportProgressFunc,e))}function Ze(t){t.comparisons+=1,t.comparisons%1e3===0&&L(t)}function me(t){t.candidateComparisons+=1,t.candidateComparisons%1e3===0&&L(t)}function ye(t){let n=new Uint32Array(t.length);for(let r=0;r<t.length;r++)n[r]=t[r];return n}function be(t,n){let r=t.length;if(r===0)return!0;let s=new Int32Array(r),_=new Int32Array(n),o=new Int32Array(r);s.fill(-1),_.fill(-1);let e=0;for(;;){let i=new Int32Array(r),c=0,u=0,m=!1;for(let f=0;f<r;f++)s[f]===-1?(o[f]=0,i[u++]=f):o[f]=-1;for(;c<u;){let f=i[c++];for(let g of t[f]){let a=_[g];a===-1?m=!0:o[a]===-1&&(o[a]=o[f]+1,i[u++]=a)}}if(!m)return e===r;let b=new Int32Array(r);for(let f=0;f<r;f++){if(s[f]!==-1)continue;let g=[f],a=[],p=!1;for(;g.length&&!p;){let d=g.length-1,h=g[d],w=t[h],l=!1;for(;b[h]<w.length;){let y=w[b[h]++],C=_[y];if(C===-1){s[h]=y,_[y]=h;for(let A=d-1;A>=0;A--){let H=g[A],U=a[A];s[H]=U,_[U]=H}p=!0;break}if(o[C]===o[h]+1){a[d]=y,g.push(C),l=!0;break}}!l&&!p&&(o[h]=-1,g.pop(),a.length=Math.max(0,g.length-1))}p&&(e+=1)}if(e===r)return!0}}function Ye(t,n,r){let{opts:s}=r,_=[{first:t,kind:"pair",path:"$",second:n}],o=j;for(;_.length;){let e=_.pop();if(e.kind==="release-pair"){Ge(r.activePairs,e.first,e.second);continue}if(e.kind==="ordered-array"){e.awaiting&&(e.firstIndex+=1,o.matched&&(e.secondIndex+=1)),e.secondIndex===e.second.length?o=j:e.firstIndex===e.first.length?o=s.verboseWhenMismatches?x(e.path,"the second array is not an ordered subset of the first array.",e.first,e.second):O:(e.awaiting=!0,_.push(e),_.push({first:e.first[e.firstIndex],kind:"pair",path:s.verboseWhenMismatches?"".concat(e.path,"[").concat(e.firstIndex,"]"):"",second:e.second[e.secondIndex]}));continue}if(e.kind==="exact-object"){if(e.awaiting){if(!o.matched)continue;e.index+=1}if(e.index<e.exactKeys.length){let l=e.exactKeys[e.index];e.awaiting=!0,_.push(e),_.push({first:e.first[l],kind:"pair",path:s.verboseWhenMismatches?N(e.path,l):"",second:e.second[l]})}else e.wildcardKeys.length?_.push({awaiting:!1,adjacency:Array.from({length:e.wildcardKeys.length},()=>[]),first:e.first,firstIndex:0,firstKeys:e.wildcardFirstKeys,keyMatchers:e.wildcardKeys.map(l=>ae(l,ue)),kind:"object-candidates",path:e.path,second:e.second,secondIndex:0,wildcardKeys:e.wildcardKeys}):o=j;continue}if(e.kind==="array-candidates"){e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),r.matchingEdges+=1),o=j,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.second.length?o=be(e.adjacency,e.first.length)?j:s.verboseWhenMismatches?x(e.path,"the second array has no injective unordered match in the first array.",e.first,e.second):O:e.firstIndex===e.first.length?(e.adjacency[e.secondIndex]=ye(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,_.push(e)):(me(r),e.awaiting=!0,_.push(e),_.push({first:e.first[e.firstIndex],kind:"pair",path:s.verboseWhenMismatches?"".concat(e.path,"[").concat(e.firstIndex,"]"):"",second:e.second[e.secondIndex]}));continue}if(e.kind==="object-candidates"){if(e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),r.matchingEdges+=1),o=j,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.wildcardKeys.length)o=be(e.adjacency,e.firstKeys.length)?j:s.verboseWhenMismatches?x(e.path,"the wildcard properties in the second object have no injective key-and-value match in the first object.",e.first,e.second):O;else if(e.firstIndex===e.firstKeys.length)e.adjacency[e.secondIndex]=ye(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,_.push(e);else{me(r);let l=e.firstKeys[e.firstIndex];if(e.keyMatchers[e.secondIndex](l)){let y=e.wildcardKeys[e.secondIndex];e.awaiting=!0,_.push(e),_.push({first:e.first[l],kind:"pair",path:s.verboseWhenMismatches?N(e.path,l):"",second:e.second[y]})}else e.firstIndex+=1,_.push(e)}continue}if(Ze(r),e.first===e.second&&(!s.useWildcards||typeof e.first!="string"&&!Array.isArray(e.first)&&!k(e.first))){o=j;continue}if(s.hungryForWhitespace&&he(e.first,r.emptyCache)&&he(e.second,r.emptyCache)){o=j;continue}if(typeof e.first=="string"&&typeof e.second=="string"){o=(s.useWildcards?ce(e.first,e.second,ue):!1)?j:s.verboseWhenMismatches?x(e.path,"the strings do not match.",e.first,e.second):O;continue}let i=Array.isArray(e.first)&&Array.isArray(e.second),c=k(e.first)&&k(e.second);if(!i&&!c){if(!s.verboseWhenMismatches){o=O;continue}let l=M(e.first)===M(e.second)?"the values are not equal.":"the value types differ (".concat(M(e.first)," versus ").concat(M(e.second),").");o=x(e.path,l,e.first,e.second);continue}let u=e.first,m=e.second;if(Qe(r.activePairs,u,m)){o=j;continue}if(i){let l=e.first,y=e.second;if(s.matchStrictly&&l.length!==y.length||y.length>l.length||y.length===0&&l.length!==0){o=s.verboseWhenMismatches?x(e.path,s.matchStrictly?"strict array matching requires equal lengths.":"the second array cannot be an empty or larger subset of the first array.",e.first,e.second):O;continue}fe(r.activePairs,u,m),_.push({first:u,kind:"release-pair",second:m}),s.arrayOrder==="any"?_.push({awaiting:!1,adjacency:Array.from({length:y.length},()=>[]),first:l,firstIndex:0,kind:"array-candidates",path:e.path,second:y,secondIndex:0}):_.push({awaiting:!1,first:l,firstIndex:0,kind:"ordered-array",path:e.path,second:y,secondIndex:0});continue}let b=e.first,f=e.second,g=Object.keys(b),a=Object.keys(f);if(s.matchStrictly&&g.length!==a.length||a.length>g.length||a.length===0&&g.length!==0){o=s.verboseWhenMismatches?x(e.path,s.matchStrictly?"strict object matching requires equal key counts.":"the second object cannot be an empty or larger subset of the first object.",e.first,e.second):O;continue}let p=[],d=[],h;for(let l of a)if(Object.prototype.propertyIsEnumerable.call(b,l))p.push(l);else if(s.useWildcards)d.push(l);else{h=l;break}if(h!==void 0){o=s.verboseWhenMismatches?x(N(e.path,h),"the first object does not have the second object's key ".concat(JSON.stringify(h),"."),void 0,f[h]):O;continue}let w=d.length?new Set(p):null;fe(r.activePairs,u,m),_.push({first:u,kind:"release-pair",second:m}),_.push({awaiting:!1,exactKeys:p,first:b,index:0,kind:"exact-object",path:e.path,second:f,wildcardFirstKeys:w?g.filter(l=>!w.has(l)):[],wildcardKeys:d})}return o}function Xe(...t){if(t.length<1)throw new TypeError("ast-compare/compare(): [THROW_ID_01] The first value is missing.");if(t.length<2)throw new TypeError("ast-compare/compare(): [THROW_ID_02] The second pattern is missing.");let[n,r,s]=t,_=et(s),o=_.reportCompletionFunc?ge():null,e={activePairs:new WeakMap,candidateComparisons:0,comparisons:0,emptyCache:new WeakMap,lastProgress:void 0,matchingEdges:0,opts:_};z(_.reportProgressFunc,_.reportProgressFuncFrom),e.lastProgress=_.reportProgressFuncFrom;let i=Ye(n,r,e);if(L(e,!0),_.reportCompletionFunc){let c=ge(),u=o===null||c===null?0:c-o;z(_.reportCompletionFunc,Object.freeze({candidateComparisons:e.candidateComparisons,comparisons:e.comparisons,matchingEdges:e.matchingEdges,timeTakenInMilliseconds:Number.isFinite(u)?Math.max(0,u):0}))}return i.matched?!0:_.verboseWhenMismatches?Je(i.mismatch):!1}function et(t){if(t!=null&&!k(t))throw new TypeError("ast-compare/compare(): [THROW_ID_03] The third argument must be a plain object, null, or undefined; received ".concat(v(t,4),"."));let n=t!=null?t:{},r=Object.keys(n).find(g=>!qe.has(g));if(r!==void 0)throw new TypeError("ast-compare/compare(): [THROW_ID_04] Unknown option ".concat(JSON.stringify(r),"."));let s=g=>oe(n,g)?n[g]:V[g],_=s("arrayOrder");if(_!=="ordered"&&_!=="any")throw new TypeError('ast-compare/compare(): [THROW_ID_05] opts.arrayOrder must be "ordered" or "any"; received '.concat(v(_,4),"."));let o=s("hungryForWhitespace");if(typeof o!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_06] opts.hungryForWhitespace must be a Boolean; received ".concat(v(o,4),"."));let e=s("matchStrictly");if(typeof e!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_07] opts.matchStrictly must be a Boolean; received ".concat(v(e,4),"."));let i=s("verboseWhenMismatches");if(typeof i!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_08] opts.verboseWhenMismatches must be a Boolean; received ".concat(v(i,4),"."));let c=s("useWildcards");if(typeof c!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_09] opts.useWildcards must be a Boolean; received ".concat(v(c,4),"."));let u=s("reportCompletionFunc");if(u!==null&&typeof u!="function")throw new TypeError("ast-compare/compare(): [THROW_ID_10] opts.reportCompletionFunc must be a function or null; received ".concat(v(u,4),"."));let m=s("reportProgressFunc");if(m!==null&&typeof m!="function")throw new TypeError("ast-compare/compare(): [THROW_ID_11] opts.reportProgressFunc must be a function or null; received ".concat(v(m,4),"."));let b=s("reportProgressFuncFrom");if(!Number.isFinite(b))throw new TypeError("ast-compare/compare(): [THROW_ID_12] opts.reportProgressFuncFrom must be a finite number; received ".concat(v(b,4),"."));let f=s("reportProgressFuncTo");if(!Number.isFinite(f))throw new TypeError("ast-compare/compare(): [THROW_ID_13] opts.reportProgressFuncTo must be a finite number; received ".concat(v(f,4),"."));if(b>f)throw new RangeError("ast-compare/compare(): [THROW_ID_14] opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ".concat(b," and ").concat(f,"."));return{arrayOrder:_,hungryForWhitespace:o,matchStrictly:e,reportCompletionFunc:u,reportProgressFunc:m,reportProgressFuncFrom:b,reportProgressFuncTo:f,verboseWhenMismatches:i,useWildcards:c}}return xe(tt);})();
|
|
10
|
+
"use strict";var astCompare=(()=>{var F=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames,q=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var J=(t,n,r)=>n in t?F(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,G=(t,n)=>{for(var r in n||(n={}))Q.call(n,r)&&J(t,r,n[r]);if(q)for(var r of q(n))je.call(n,r)&&J(t,r,n[r]);return t};var ke=(t,n)=>{for(var r in n)F(t,r,{get:n[r],enumerable:!0})},Oe=(t,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let _ of ve(n))!Q.call(t,_)&&_!==r&&F(t,_,{get:()=>n[_],enumerable:!(s=we(n,_))||s.enumerable});return t};var xe=t=>Oe(F({},"__esModule",{value:!0}),t);var tt={};ke(tt,{compare:()=>Xe,defaults:()=>Ue,version:()=>He});function Ae(){let t=[],n=0,r=!1;return{append(s){return r?!1:n+s.length>1999?(t.push("\u2026"),n+=1,r=!0,!1):(t.push(s),n+=s.length,!0)},result(){return t.join("")},stopped(){return r}}}function Ce(t){return"\\u".concat(t.toString(16).padStart(4,"0"))}function I(t,n){if(t.append('"')){for(let r=0;r<n.length&&!t.stopped();r+=1){let s=n.charCodeAt(r);s===34?t.append('\\"'):s===92?t.append("\\\\"):s===8?t.append("\\b"):s===9?t.append("\\t"):s===10?t.append("\\n"):s===12?t.append("\\f"):s===13?t.append("\\r"):s<32||s===8232||s===8233||s>=55296&&s<=57343?t.append(Ce(s)):t.append(n[r])}t.append('"')}}function Fe(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function Y(t,n){t.append("Symbol(");let r=String(n);r.length>8&&I(t,r.slice(7,-1)),t.append(")")}function Z(t,n){typeof n=="symbol"?Y(t,n):I(t,String(n))}function v(t,n=0){let r=Ae(),s=n===4?4:0,_=new WeakSet,o=0;function e(a){s&&r.append(" ".repeat(a*s))}function i(a,p){a&&r.append(","),s&&(r.append("\n"),e(p+1))}function c(a,p,d){s&&p&&(r.append("\n"),e(d)),r.append(a)}function u(a,p){Object.prototype.hasOwnProperty.call(a,"value")?g(a.value,p):r.append(Fe(a))}function m(a,p){let d;try{d=Reflect.getOwnPropertyDescriptor(a,"length")}catch(l){r.append("[Uninspectable]");return}let h=d==null?void 0:d.value;if(!Number.isSafeInteger(h)||h<0){r.append("[Uninspectable]");return}r.append("[");let w=!1;for(let l=0;l<h&&!r.stopped();l+=1){if(i(w,p),w=!0,o>=50){r.append("[MaxEntries]");break}o+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(a,String(l))}catch(A){r.append("[Uninspectable]");continue}y!=null&&y.enumerable?u(y,p+1):r.append("[Empty]")}c("]",w,p)}function b(a,p){let d;try{d=Reflect.ownKeys(a)}catch(w){r.append("[Uninspectable]");return}r.append("{");let h=!1;for(let w of d){if(r.stopped())break;if(o>=50){i(h,p),h=!0,I(r,"\u2026"),r.append(s?": ":":"),r.append("[MaxEntries]");break}o+=1;let l;try{l=Reflect.getOwnPropertyDescriptor(a,w)}catch(y){i(h,p),h=!0,Z(r,w),r.append(s?": ":":"),r.append("[Uninspectable]");continue}l!=null&&l.enumerable&&(i(h,p),h=!0,Z(r,w),r.append(s?": ":":"),u(l,p+1))}c("}",h,p)}function f(a,p){if(_.has(a)){r.append("[Circular]");return}if(p>=5){r.append("[MaxDepth]");return}let d;try{d=Array.isArray(a)}catch(h){r.append("[Uninspectable]");return}_.add(a);try{d?m(a,p):b(a,p)}finally{_.delete(a)}}function g(a,p){a===null?r.append("null"):typeof a=="string"?I(r,a):typeof a=="number"?r.append(Object.is(a,-0)?"-0":String(a)):typeof a=="boolean"?r.append(a?"true":"false"):typeof a>"u"?r.append("undefined"):typeof a=="bigint"?r.append("".concat(a,"n")):typeof a=="symbol"?Y(r,a):typeof a=="function"?r.append("[Function]"):f(a,p)}try{return g(t,0),r.result()}catch(a){return"[Uninspectable]"}}var Ie=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),S=Ie.slice(1).split("_"),We=[],X=127;for(let t=0;t<S.length;t+=2){let n=X+1+Number.parseInt(S[t],36),r=n+Number.parseInt(S[t+1],36);We.push([n,r]),X=r}var ot=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Pe=Object.prototype.hasOwnProperty,_e=Function.prototype.toString,Me=_e.call(Object);var it=Map.prototype.entries,at=Set.prototype.values;var te,ct=(te=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:te.get,re,lt=(re=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:re.get,ne,ut=(ne=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:ne.get,se,ft=(se=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:se.get,pt=RegExp.prototype.test;function k(t){var s;if(t==null||typeof t!="object")return!1;let n=Object.getPrototypeOf(t);if(n===null||n===Object.prototype)return!0;let r=Object.getOwnPropertyDescriptor(n,"constructor");return!r||!("value"in r)||typeof r.value!="function"?!1:((s=Object.getOwnPropertyDescriptor(r.value,"prototype"))==null?void 0:s.value)===n&&_e.call(r.value)===Me}var dt=Date.prototype.getTime;function oe(t,n){return t!=null&&Pe.call(t,n)}var Se=256,Re=1024,Ee=1,De=new Map,Te=new Map;function D(t){if(t>=97&&t<=122)return t-32;if(t>65535)return t;let n=String.fromCharCode(t).toUpperCase();if(n.length!==1)return t;let r=n.charCodeAt(0);return t>127&&r<128?t:r}function R(t,n,r,s,_,o){for(let e=0;e<_;e++){let i=t.charCodeAt(n+e),c=r.charCodeAt(s+e);if(o||(i>=97&&i<=122&&(i-=32),c>=97&&c<=122&&(c-=32)),i!==c)return!1}return!0}function ie(t,n,r){let s=n.indexOf("\\");if(s===-1&&t===n)return!0;let _=n.indexOf("*");if(s===-1&&_===-1){if(r)return!1;for(let m=0;m<n.length;m++)if(n.charCodeAt(m)>127)return;return t.length===n.length&&R(t,0,n,0,n.length,!1)}if(s!==-1)return;let o=0,e=!1,i=-1;for(let m=0;m<n.length;m++){let b=n.charCodeAt(m);if(b>127)return;if(b===42){if(i=m,!e){if(o++,o>1)return;e=!0}}else e=!1}let c=i+1,u=n.length-c;return t.length<_+u?!1:R(t,0,n,0,_,r)&&R(t,t.length-u,n,c,u,r)}function $e(t){let n=new Uint32Array(t.length),r=0;for(let s=1;s<t.length;s++){for(;r>0&&t[s]!==t[r];)r=n[r-1];t[s]===t[r]&&r++,n[s]=r}return n}function Ke(t,n){let r=[[]],s=!0,_=!1,o=!1,e=0;for(let f=0;f<t.length;){let g=t.codePointAt(f);if(g!==92){if(g===42)_=!0,o||(r.push([]),o=!0);else{let l=n?g:D(g);r[r.length-1].push(l),s&&(s=l<=127),e++,o=!1}f+=g>65535?2:1;continue}let a=f+1;for(;t.charCodeAt(a)===92;)a++;let p=a-f,d=t.codePointAt(a),h,w=!1;d===42?(w=p%2===0,h=w?p/2:(p-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?h=Math.ceil(p/2):h=Math.floor(p/2);for(let l=0;l<h;l++)r[r.length-1].push(92),e++;if(w){o=!1,f=a;continue}if(d!==void 0){let l=n?d:D(d);r[r.length-1].push(l),s&&(s=l<=127),e++,a+=d>65535?2:1}o=!1,f=a}let i=_&&r[0].length===0,c=_&&r[r.length-1].length===0,u=[];for(let f of r)f.length&&u.push({values:f});let m=i?0:1,b=u.length-(c?0:1);for(let f=m;f<b;f++)u[f].values.length>Ee&&(u[f].failure=$e(u[f].values));return{asciiOnly:s,endsWithWildcard:c,hasWildcard:_,minimumInputLength:e,segments:u,startsWithWildcard:i}}function T(t,n){let r=n?De:Te,s=t.length<=Re;if(s){let o=r.get(t);if(o)return o}let _=Ke(t,n);if(s){if(r.size>=Se){let o=r.keys().next().value;o!==void 0&&r.delete(o)}r.set(t,_)}return _}function $(t,n){if(n){let _=[];for(let o=0;o<t.length;){let e=t.codePointAt(o);_.push(e),o+=e>65535?2:1}return _}let r=new Uint32Array(t.length),s=0;for(let _=0;_<t.length;){let o=t.codePointAt(_);r[s]=D(o),s++,_+=o>65535?2:1}return s===r.length?r:r.subarray(0,s)}function W(t,n,r,s){for(let _=0;_<r.values.length;_++){let o=t.charCodeAt(n+_);if(!s&&o>=97&&o<=122&&(o-=32),o!==r.values[_])return!1}return!0}function Be(t,n,r,s,_){let o=s-n.values.length;if(o<r)return-1;if(!n.failure){for(let i=r;i<=o;i++)if(W(t,i,n,_))return i;return-1}let e=0;for(let i=r;i<s;i++){let c=t.charCodeAt(i);for(!_&&c>=97&&c<=122&&(c-=32);e>0&&c!==n.values[e];)e=n.failure[e-1];if(c===n.values[e]&&(e++,e===n.values.length))return i-e+1}return-1}function K(t,n,r){if(t.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return t.length===n.minimumInputLength&&W(t,0,n.segments[0],r);let s=0,_=n.segments.length,o=0,e=t.length;if(!n.startsWithWildcard){let i=n.segments[0];if(!W(t,0,i,r))return!1;o=i.values.length,s++}if(!n.endsWithWildcard){_--;let i=n.segments[_];if(e-=i.values.length,!W(t,e,i,r))return!1}for(let i=s;i<_;i++){let c=n.segments[i],u=Be(t,c,o,e,r);if(u===-1)return!1;o=u+c.values.length}return!0}function P(t,n,r){for(let s=0;s<r.values.length;s++)if(t[n+s]!==r.values[s])return!1;return!0}function Ne(t,n,r,s){let _=s-n.values.length;if(_<r)return-1;if(!n.failure){for(let e=r;e<=_;e++)if(P(t,e,n))return e;return-1}let o=0;for(let e=r;e<s;e++){for(;o>0&&t[e]!==n.values[o];)o=n.failure[o-1];if(t[e]===n.values[o]&&(o++,o===n.values.length))return e-o+1}return-1}function B(t,n){if(t.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return t.length===n.minimumInputLength&&P(t,0,n.segments[0]);let r=0,s=n.segments.length,_=0,o=t.length;if(!n.startsWithWildcard){let e=n.segments[0];if(!P(t,0,e))return!1;_=e.values.length,r++}if(!n.endsWithWildcard){s--;let e=n.segments[s];if(o-=e.values.length,!P(t,o,e))return!1}for(let e=r;e<s;e++){let i=n.segments[e],c=Ne(t,i,_,o);if(c===-1)return!1;_=c+i.values.length}return!0}function ze(t,n,r){let s=ie(t,n,r);if(s!==void 0)return s;let _=T(n,r);return _.asciiOnly?K(t,_,r):B($(t,r),_)}function ee(t,n,r,s){var e;let _=ie(t,n,r);if(_!==void 0)return _;let o=T(n,r);return o.asciiOnly?K(t,o,r):((e=s.tokens)!=null||(s.tokens=$(t,r)),B(s.tokens,o))}function Ve(t,n){let r=t.charCodeAt(0)===33,s=r?t.slice(1):t;return{compiled:s.length===0?void 0:T(s,n),negative:r}}function E(t,n,r,s){var o;let _;return n.compiled?n.compiled.asciiOnly?_=K(t,n.compiled,r):((o=s.tokens)!=null||(s.tokens=$(t,r)),_=B(s.tokens,n.compiled)):_=t.length===0,n.negative?!_:_}function ae(t,n){let r=(n==null?void 0:n.caseSensitiveMatch)===!0,s=typeof t=="string"?[t]:Array.from(new Set(t));if(s.length===0)return()=>!1;let _=s.map(o=>Ve(o,r));if(typeof t=="string"){let o=_[0];return e=>E(e,o,r,{})}return o=>{let e={},i=!1,c=!1;for(let u of _)if(u.negative){if(!E(o,u,r,e))return!1}else i=!0,!c&&E(o,u,r,e)&&(c=!0);return i?c:!0}}function ce(t,n,r){if(typeof n!="string"&&!n.length)return!1;let s=r===void 0?!1:r.caseSensitiveMatch===!0;if(typeof n=="string"){let i=n.charCodeAt(0)===33,c=i?n.slice(1):n,u=ze(t,c,s);return i?!u:u}let _={},o=!1,e=!1;for(let i of n){let c=i.charCodeAt(0)===33,u=c?i.slice(1):i;if(c){if(ee(t,u,s,_))return!1}else o=!0,!e&&ee(t,u,s,_)&&(e=!0)}return o?e:!0}var le="4.2.7";var He=le,V=Object.freeze({arrayOrder:"ordered",hungryForWhitespace:!1,matchStrictly:!1,reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,verboseWhenMismatches:!1,useWildcards:!1}),Ue=Object.freeze(G({},V)),qe=new Set(Object.keys(V)),ue=Object.freeze({caseSensitiveMatch:!0}),O=Object.freeze({matched:!1}),j=Object.freeze({matched:!0});function x(t,n,r,s){return{matched:!1,mismatch:{first:r,path:t,reason:n,second:s}}}function N(t,n){return"".concat(t,"[").concat(JSON.stringify(n),"]")}function M(t){return t===null?"null":Array.isArray(t)?"array":k(t)?"plain object":typeof t}function Je(t){return"Mismatch at ".concat(t.path,": ").concat(t.reason," First value is ").concat(v(t.first,4),"; second pattern is ").concat(v(t.second,4),".")}function Qe(t,n,r){var s;return((s=t.get(n))==null?void 0:s.has(r))===!0}function fe(t,n,r){let s=t.get(n);s||(s=new WeakSet,t.set(n,s)),s.add(r)}function Ge(t,n,r){var s;(s=t.get(n))==null||s.delete(r)}function pe(t){return typeof t=="string"&&t.trim().length===0}function de(t){if(Array.isArray(t)){let n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=t[r];return n}return Object.keys(t).map(n=>t[n])}function he(t,n){if(!Array.isArray(t)&&!k(t))return pe(t);let r=n.get(t);if(r!==void 0)return r;let s=new WeakSet,_=[{allEmpty:!0,children:de(t),index:0,value:t}];s.add(t);let o=!1;for(;_.length;){let e=_[_.length-1];if(!e.allEmpty||e.index===e.children.length){o=e.allEmpty,n.set(e.value,o),s.delete(e.value),_.pop(),_.length&&!o&&(_[_.length-1].allEmpty=!1);continue}let i=e.children[e.index++];if(!Array.isArray(i)&&!k(i)){pe(i)||(e.allEmpty=!1);continue}let c=n.get(i);c!==void 0?c||(e.allEmpty=!1):s.has(i)?e.allEmpty=!1:(s.add(i),_.push({allEmpty:!0,children:de(i),index:0,value:i}))}return o}function z(t,n){if(t)try{t(n)}catch(r){}}function ge(){try{let t=Date.now();return Number.isFinite(t)?t:null}catch(t){return null}}function L(t,n=!1){let{opts:r}=t;if(!r.reportProgressFunc)return;let s=r.reportProgressFuncTo-r.reportProgressFuncFrom,_=t.comparisons+t.candidateComparisons,o=Math.min(.99,_/(_+1e3)),e=n?r.reportProgressFuncTo:Number.isFinite(s)?r.reportProgressFuncFrom+s*o:r.reportProgressFuncFrom*(1-o)+r.reportProgressFuncTo*o;e!==t.lastProgress&&(t.lastProgress=e,z(r.reportProgressFunc,e))}function Ze(t){t.comparisons+=1,t.comparisons%1e3===0&&L(t)}function me(t){t.candidateComparisons+=1,t.candidateComparisons%1e3===0&&L(t)}function ye(t){let n=new Uint32Array(t.length);for(let r=0;r<t.length;r++)n[r]=t[r];return n}function be(t,n){let r=t.length;if(r===0)return!0;let s=new Int32Array(r),_=new Int32Array(n),o=new Int32Array(r);s.fill(-1),_.fill(-1);let e=0;for(;;){let i=new Int32Array(r),c=0,u=0,m=!1;for(let f=0;f<r;f++)s[f]===-1?(o[f]=0,i[u++]=f):o[f]=-1;for(;c<u;){let f=i[c++];for(let g of t[f]){let a=_[g];a===-1?m=!0:o[a]===-1&&(o[a]=o[f]+1,i[u++]=a)}}if(!m)return e===r;let b=new Int32Array(r);for(let f=0;f<r;f++){if(s[f]!==-1)continue;let g=[f],a=[],p=!1;for(;g.length&&!p;){let d=g.length-1,h=g[d],w=t[h],l=!1;for(;b[h]<w.length;){let y=w[b[h]++],A=_[y];if(A===-1){s[h]=y,_[y]=h;for(let C=d-1;C>=0;C--){let H=g[C],U=a[C];s[H]=U,_[U]=H}p=!0;break}if(o[A]===o[h]+1){a[d]=y,g.push(A),l=!0;break}}!l&&!p&&(o[h]=-1,g.pop(),a.length=Math.max(0,g.length-1))}p&&(e+=1)}if(e===r)return!0}}function Ye(t,n,r){let{opts:s}=r,_=[{first:t,kind:"pair",path:"$",second:n}],o=j;for(;_.length;){let e=_.pop();if(e.kind==="release-pair"){Ge(r.activePairs,e.first,e.second);continue}if(e.kind==="ordered-array"){e.awaiting&&(e.firstIndex+=1,o.matched&&(e.secondIndex+=1)),e.secondIndex===e.second.length?o=j:e.firstIndex===e.first.length?o=s.verboseWhenMismatches?x(e.path,"the second array is not an ordered subset of the first array.",e.first,e.second):O:(e.awaiting=!0,_.push(e),_.push({first:e.first[e.firstIndex],kind:"pair",path:s.verboseWhenMismatches?"".concat(e.path,"[").concat(e.firstIndex,"]"):"",second:e.second[e.secondIndex]}));continue}if(e.kind==="exact-object"){if(e.awaiting){if(!o.matched)continue;e.index+=1}if(e.index<e.exactKeys.length){let l=e.exactKeys[e.index];e.awaiting=!0,_.push(e),_.push({first:e.first[l],kind:"pair",path:s.verboseWhenMismatches?N(e.path,l):"",second:e.second[l]})}else e.wildcardKeys.length?_.push({awaiting:!1,adjacency:Array.from({length:e.wildcardKeys.length},()=>[]),first:e.first,firstIndex:0,firstKeys:e.wildcardFirstKeys,keyMatchers:e.wildcardKeys.map(l=>ae(l,ue)),kind:"object-candidates",path:e.path,second:e.second,secondIndex:0,wildcardKeys:e.wildcardKeys}):o=j;continue}if(e.kind==="array-candidates"){e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),r.matchingEdges+=1),o=j,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.second.length?o=be(e.adjacency,e.first.length)?j:s.verboseWhenMismatches?x(e.path,"the second array has no injective unordered match in the first array.",e.first,e.second):O:e.firstIndex===e.first.length?(e.adjacency[e.secondIndex]=ye(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,_.push(e)):(me(r),e.awaiting=!0,_.push(e),_.push({first:e.first[e.firstIndex],kind:"pair",path:s.verboseWhenMismatches?"".concat(e.path,"[").concat(e.firstIndex,"]"):"",second:e.second[e.secondIndex]}));continue}if(e.kind==="object-candidates"){if(e.awaiting&&(o.matched&&(e.adjacency[e.secondIndex].push(e.firstIndex),r.matchingEdges+=1),o=j,e.firstIndex+=1,e.awaiting=!1),e.secondIndex===e.wildcardKeys.length)o=be(e.adjacency,e.firstKeys.length)?j:s.verboseWhenMismatches?x(e.path,"the wildcard properties in the second object have no injective key-and-value match in the first object.",e.first,e.second):O;else if(e.firstIndex===e.firstKeys.length)e.adjacency[e.secondIndex]=ye(e.adjacency[e.secondIndex]),e.firstIndex=0,e.secondIndex+=1,_.push(e);else{me(r);let l=e.firstKeys[e.firstIndex];if(e.keyMatchers[e.secondIndex](l)){let y=e.wildcardKeys[e.secondIndex];e.awaiting=!0,_.push(e),_.push({first:e.first[l],kind:"pair",path:s.verboseWhenMismatches?N(e.path,l):"",second:e.second[y]})}else e.firstIndex+=1,_.push(e)}continue}if(Ze(r),e.first===e.second&&(!s.useWildcards||typeof e.first!="string"&&!Array.isArray(e.first)&&!k(e.first))){o=j;continue}if(s.hungryForWhitespace&&he(e.first,r.emptyCache)&&he(e.second,r.emptyCache)){o=j;continue}if(typeof e.first=="string"&&typeof e.second=="string"){o=(s.useWildcards?ce(e.first,e.second,ue):!1)?j:s.verboseWhenMismatches?x(e.path,"the strings do not match.",e.first,e.second):O;continue}let i=Array.isArray(e.first)&&Array.isArray(e.second),c=k(e.first)&&k(e.second);if(!i&&!c){if(!s.verboseWhenMismatches){o=O;continue}let l=M(e.first)===M(e.second)?"the values are not equal.":"the value types differ (".concat(M(e.first)," versus ").concat(M(e.second),").");o=x(e.path,l,e.first,e.second);continue}let u=e.first,m=e.second;if(Qe(r.activePairs,u,m)){o=j;continue}if(i){let l=e.first,y=e.second;if(s.matchStrictly&&l.length!==y.length||y.length>l.length||y.length===0&&l.length!==0){o=s.verboseWhenMismatches?x(e.path,s.matchStrictly?"strict array matching requires equal lengths.":"the second array cannot be an empty or larger subset of the first array.",e.first,e.second):O;continue}fe(r.activePairs,u,m),_.push({first:u,kind:"release-pair",second:m}),s.arrayOrder==="any"?_.push({awaiting:!1,adjacency:Array.from({length:y.length},()=>[]),first:l,firstIndex:0,kind:"array-candidates",path:e.path,second:y,secondIndex:0}):_.push({awaiting:!1,first:l,firstIndex:0,kind:"ordered-array",path:e.path,second:y,secondIndex:0});continue}let b=e.first,f=e.second,g=Object.keys(b),a=Object.keys(f);if(s.matchStrictly&&g.length!==a.length||a.length>g.length||a.length===0&&g.length!==0){o=s.verboseWhenMismatches?x(e.path,s.matchStrictly?"strict object matching requires equal key counts.":"the second object cannot be an empty or larger subset of the first object.",e.first,e.second):O;continue}let p=[],d=[],h;for(let l of a)if(Object.prototype.propertyIsEnumerable.call(b,l))p.push(l);else if(s.useWildcards)d.push(l);else{h=l;break}if(h!==void 0){o=s.verboseWhenMismatches?x(N(e.path,h),"the first object does not have the second object's key ".concat(JSON.stringify(h),"."),void 0,f[h]):O;continue}let w=d.length?new Set(p):null;fe(r.activePairs,u,m),_.push({first:u,kind:"release-pair",second:m}),_.push({awaiting:!1,exactKeys:p,first:b,index:0,kind:"exact-object",path:e.path,second:f,wildcardFirstKeys:w?g.filter(l=>!w.has(l)):[],wildcardKeys:d})}return o}function Xe(...t){if(t.length<1)throw new TypeError("ast-compare/compare(): [THROW_ID_01] The first value is missing.");if(t.length<2)throw new TypeError("ast-compare/compare(): [THROW_ID_02] The second pattern is missing.");let[n,r,s]=t,_=et(s),o=_.reportCompletionFunc?ge():null,e={activePairs:new WeakMap,candidateComparisons:0,comparisons:0,emptyCache:new WeakMap,lastProgress:void 0,matchingEdges:0,opts:_};z(_.reportProgressFunc,_.reportProgressFuncFrom),e.lastProgress=_.reportProgressFuncFrom;let i=Ye(n,r,e);if(L(e,!0),_.reportCompletionFunc){let c=ge(),u=o===null||c===null?0:c-o;z(_.reportCompletionFunc,Object.freeze({candidateComparisons:e.candidateComparisons,comparisons:e.comparisons,matchingEdges:e.matchingEdges,timeTakenInMilliseconds:Number.isFinite(u)?Math.max(0,u):0}))}return i.matched?!0:_.verboseWhenMismatches?Je(i.mismatch):!1}function et(t){if(t!=null&&!k(t))throw new TypeError("ast-compare/compare(): [THROW_ID_03] The third argument must be a plain object, null, or undefined; received ".concat(v(t,4),"."));let n=t!=null?t:{},r=Object.keys(n).find(g=>!qe.has(g));if(r!==void 0)throw new TypeError("ast-compare/compare(): [THROW_ID_04] Unknown option ".concat(JSON.stringify(r),"."));let s=g=>oe(n,g)?n[g]:V[g],_=s("arrayOrder");if(_!=="ordered"&&_!=="any")throw new TypeError('ast-compare/compare(): [THROW_ID_05] opts.arrayOrder must be "ordered" or "any"; received '.concat(v(_,4),"."));let o=s("hungryForWhitespace");if(typeof o!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_06] opts.hungryForWhitespace must be a Boolean; received ".concat(v(o,4),"."));let e=s("matchStrictly");if(typeof e!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_07] opts.matchStrictly must be a Boolean; received ".concat(v(e,4),"."));let i=s("verboseWhenMismatches");if(typeof i!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_08] opts.verboseWhenMismatches must be a Boolean; received ".concat(v(i,4),"."));let c=s("useWildcards");if(typeof c!="boolean")throw new TypeError("ast-compare/compare(): [THROW_ID_09] opts.useWildcards must be a Boolean; received ".concat(v(c,4),"."));let u=s("reportCompletionFunc");if(u!==null&&typeof u!="function")throw new TypeError("ast-compare/compare(): [THROW_ID_10] opts.reportCompletionFunc must be a function or null; received ".concat(v(u,4),"."));let m=s("reportProgressFunc");if(m!==null&&typeof m!="function")throw new TypeError("ast-compare/compare(): [THROW_ID_11] opts.reportProgressFunc must be a function or null; received ".concat(v(m,4),"."));let b=s("reportProgressFuncFrom");if(!Number.isFinite(b))throw new TypeError("ast-compare/compare(): [THROW_ID_12] opts.reportProgressFuncFrom must be a finite number; received ".concat(v(b,4),"."));let f=s("reportProgressFuncTo");if(!Number.isFinite(f))throw new TypeError("ast-compare/compare(): [THROW_ID_13] opts.reportProgressFuncTo must be a finite number; received ".concat(v(f,4),"."));if(b>f)throw new RangeError("ast-compare/compare(): [THROW_ID_14] opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ".concat(b," and ").concat(f,"."));return{arrayOrder:_,hungryForWhitespace:o,matchStrictly:e,reportCompletionFunc:u,reportProgressFunc:m,reportProgressFuncFrom:b,reportProgressFuncTo:f,verboseWhenMismatches:i,useWildcards:c}}return xe(tt);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-format-diagnostic-value
|
|
13
13
|
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name codsen-utils
|
|
21
21
|
* @fileoverview Various utility functions
|
|
22
|
-
* @version 1.10.
|
|
22
|
+
* @version 1.10.3
|
|
23
23
|
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-compare",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.7",
|
|
4
4
|
"description": "Compare anything: AST, objects, arrays, strings and nested thereof",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"codsen-utils": "^1.10.
|
|
79
|
+
"codsen-utils": "^1.10.3"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": ">=18.20.8"
|