ast-deep-contains 5.1.0 → 5.1.3
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.
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-deep-contains
|
|
3
3
|
* @fileoverview Like t.same assert on array of objects, where element order doesn't matter.
|
|
4
|
-
* @version 5.1.
|
|
4
|
+
* @version 5.1.3
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-deep-contains/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import h from"object-path";import{traverse as J}from"ast-monkey-traverse";import l from"@sindresorhus/is";var V="5.1.
|
|
10
|
+
import h from"object-path";import{traverse as J}from"ast-monkey-traverse";import l from"@sindresorhus/is";var V="5.1.3";var F=V;function j(n){if(n.includes(".")){for(let s=n.length;s--;)if(n[s]===".")return n.slice(0,s)}return n}function k(n,s){return Array.from(n).filter((b,c)=>c!==s)}var x={skipContainers:!0,arrayStrictComparison:!1};function w(n,s,b,c,O){let f={...x,...O};l(n)!==l(s)?c(`the first input arg is of a type ${l(n).toLowerCase()} but the second is ${l(s).toLowerCase()}. Values are - 1st:
|
|
11
11
|
${JSON.stringify(n,null,4)}
|
|
12
12
|
2nd:
|
|
13
13
|
${JSON.stringify(s,null,4)}`):J(s,(D,E,a,v)=>{let d=E!==void 0?E:D,{path:$}=a;if(h.has(n,$))if(!f.arrayStrictComparison&&l.plainObject(d)&&a.parentType==="array"&&a.parent.length>1){v.now=!0;let o=Array.from(a.path.includes(".")?h.get(n,j($)):n);if(o.length<a.parent.length)c(`the first array: ${JSON.stringify(o,null,4)}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-deep-contains
|
|
3
3
|
* @fileoverview Like t.same assert on array of objects, where element order doesn't matter.
|
|
4
|
-
* @version 5.1.
|
|
4
|
+
* @version 5.1.3
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-deep-contains/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var astDeepContains=(()=>{var Cr=Object.create;var F=Object.defineProperty,Pr=Object.defineProperties,Ur=Object.getOwnPropertyDescriptor,Vr=Object.getOwnPropertyDescriptors,Mr=Object.getOwnPropertyNames,Q=Object.getOwnPropertySymbols,Rr=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable;var q=(r,t,u)=>t in r?F(r,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[t]=u,T=(r,t)=>{for(var u in t||(t={}))z.call(t,u)&&q(r,u,t[u]);if(Q)for(var u of Q(t))Lr.call(t,u)&&q(r,u,t[u]);return r},B=(r,t)=>Pr(r,Vr(t));var Y=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Wr=(r,t)=>{for(var u in t)F(r,u,{get:t[u],enumerable:!0})},Z=(r,t,u,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let w of Mr(t))!z.call(r,w)&&w!==u&&F(r,w,{get:()=>t[w],enumerable:!(d=Ur(t,w))||d.enumerable});return r};var W=(r,t,u)=>(u=r!=null?Cr(Rr(r)):{},Z(t||!r||!r.__esModule?F(u,"default",{value:r,enumerable:!0}):u,r)),Gr=r=>Z(F({},"__esModule",{value:!0}),r);var v=Y((X,M)=>{(function(r,t){"use strict";typeof M=="object"&&typeof M.exports=="object"?M.exports=t():typeof define=="function"&&define.amd?define([],t):r.objectPath=t()})(X,function(){"use strict";var r=Object.prototype.toString;function t(o,n){return o==null?!1:Object.prototype.hasOwnProperty.call(o,n)}function u(o){if(!o||A(o)&&o.length===0)return!0;if(typeof o!="string"){for(var n in o)if(t(o,n))return!1;return!0}return!1}function d(o){return r.call(o)}function w(o){return typeof o=="object"&&d(o)==="[object Object]"}var A=Array.isArray||function(o){return r.call(o)==="[object Array]"};function a(o){return typeof o=="boolean"||d(o)==="[object Boolean]"}function s(o){var n=parseInt(o);return n.toString()===o?n:o}function i(o){o=o||{};var n=function(p){return Object.keys(n).reduce(function(e,f){return f==="create"||typeof n[f]=="function"&&(e[f]=n[f].bind(n,p)),e},{})},l;o.includeInheritedProps?l=function(){return!0}:l=function(p,e){return typeof e=="number"&&Array.isArray(p)||t(p,e)};function S(p,e){if(l(p,e))return p[e]}var x;o.includeInheritedProps?x=function(p,e){typeof e!="string"&&typeof e!="number"&&(e=String(e));var f=S(p,e);if(e==="__proto__"||e==="prototype"||e==="constructor"&&typeof f=="function")throw new Error("For security reasons, object's magic properties cannot be set");return f}:x=function(p,e){return S(p,e)};function I(p,e,f,y){if(typeof e=="number"&&(e=[e]),!e||e.length===0)return p;if(typeof e=="string")return I(p,e.split(".").map(s),f,y);var h=e[0],E=x(p,h);return e.length===1?((E===void 0||!y)&&(p[h]=f),E):(E===void 0&&(typeof e[1]=="number"?p[h]=[]:p[h]={}),I(p[h],e.slice(1),f,y))}return n.has=function(p,e){if(typeof e=="number"?e=[e]:typeof e=="string"&&(e=e.split(".")),!e||e.length===0)return!!p;for(var f=0;f<e.length;f++){var y=s(e[f]);if(typeof y=="number"&&A(p)&&y<p.length||(o.includeInheritedProps?y in Object(p):t(p,y)))p=p[y];else return!1}return!0},n.ensureExists=function(p,e,f){return I(p,e,f,!0)},n.set=function(p,e,f,y){return I(p,e,f,y)},n.insert=function(p,e,f,y){var h=n.get(p,e);y=~~y,A(h)||(h=[],n.set(p,e,h)),h.splice(y,0,f)},n.empty=function(p,e){if(!u(e)&&p!=null){var f,y;if(f=n.get(p,e)){if(typeof f=="string")return n.set(p,e,"");if(a(f))return n.set(p,e,!1);if(typeof f=="number")return n.set(p,e,0);if(A(f))f.length=0;else if(w(f))for(y in f)l(f,y)&&delete f[y];else return n.set(p,e,null)}}},n.push=function(p,e){var f=n.get(p,e);A(f)||(f=[],n.set(p,e,f)),f.push.apply(f,Array.prototype.slice.call(arguments,2))},n.coalesce=function(p,e,f){for(var y,h=0,E=e.length;h<E;h++)if((y=n.get(p,e[h]))!==void 0)return y;return f},n.get=function(p,e,f){if(typeof e=="number"&&(e=[e]),!e||e.length===0)return p;if(p==null)return f;if(typeof e=="string")return n.get(p,e.split("."),f);var y=s(e[0]),h=x(p,y);return h===void 0?f:e.length===1?h:n.get(p[y],e.slice(1),f)},n.del=function(e,f){if(typeof f=="number"&&(f=[f]),e==null||u(f))return e;if(typeof f=="string")return n.del(e,f.split("."));var y=s(f[0]);if(x(e,y),!l(e,y))return e;if(f.length===1)A(e)?e.splice(y,1):delete e[y];else return n.del(e[y],f.slice(1));return e},n}var c=i();return c.create=i,c.withInheritedProps=i({includeInheritedProps:!0}),c})});var G=Y((dn,rr)=>{"use strict";rr.exports=Jr;function k(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function Jr(r){if(r=r||{},r.circles)return gr(r);let t=new Map;if(t.set(Date,a=>new Date(a)),t.set(Map,(a,s)=>new Map(d(Array.from(a),s))),t.set(Set,(a,s)=>new Set(d(Array.from(a),s))),r.constructorHandlers)for(let a of r.constructorHandlers)t.set(a[0],a[1]);let u=null;return r.proto?A:w;function d(a,s){let i=Object.keys(a),c=new Array(i.length);for(let o=0;o<i.length;o++){let n=i[o],l=a[n];typeof l!="object"||l===null?c[n]=l:l.constructor!==Object&&(u=t.get(l.constructor))?c[n]=u(l,s):ArrayBuffer.isView(l)?c[n]=k(l):c[n]=s(l)}return c}function w(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return d(a,w);if(a.constructor!==Object&&(u=t.get(a.constructor)))return u(a,w);let s={};for(let i in a){if(Object.hasOwnProperty.call(a,i)===!1)continue;let c=a[i];typeof c!="object"||c===null?s[i]=c:c.constructor!==Object&&(u=t.get(c.constructor))?s[i]=u(c,w):ArrayBuffer.isView(c)?s[i]=k(c):s[i]=w(c)}return s}function A(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return d(a,A);if(a.constructor!==Object&&(u=t.get(a.constructor)))return u(a,A);let s={};for(let i in a){let c=a[i];typeof c!="object"||c===null?s[i]=c:c.constructor!==Object&&(u=t.get(c.constructor))?s[i]=u(c,A):ArrayBuffer.isView(c)?s[i]=k(c):s[i]=A(c)}return s}}function gr(r){let t=[],u=[],d=new Map;if(d.set(Date,i=>new Date(i)),d.set(Map,(i,c)=>new Map(A(Array.from(i),c))),d.set(Set,(i,c)=>new Set(A(Array.from(i),c))),r.constructorHandlers)for(let i of r.constructorHandlers)d.set(i[0],i[1]);let w=null;return r.proto?s:a;function A(i,c){let o=Object.keys(i),n=new Array(o.length);for(let l=0;l<o.length;l++){let S=o[l],x=i[S];if(typeof x!="object"||x===null)n[S]=x;else if(x.constructor!==Object&&(w=d.get(x.constructor)))n[S]=w(x,c);else if(ArrayBuffer.isView(x))n[S]=k(x);else{let I=t.indexOf(x);I!==-1?n[S]=u[I]:n[S]=c(x)}}return n}function a(i){if(typeof i!="object"||i===null)return i;if(Array.isArray(i))return A(i,a);if(i.constructor!==Object&&(w=d.get(i.constructor)))return w(i,a);let c={};t.push(i),u.push(c);for(let o in i){if(Object.hasOwnProperty.call(i,o)===!1)continue;let n=i[o];if(typeof n!="object"||n===null)c[o]=n;else if(n.constructor!==Object&&(w=d.get(n.constructor)))c[o]=w(n,a);else if(ArrayBuffer.isView(n))c[o]=k(n);else{let l=t.indexOf(n);l!==-1?c[o]=u[l]:c[o]=a(n)}}return t.pop(),u.pop(),c}function s(i){if(typeof i!="object"||i===null)return i;if(Array.isArray(i))return A(i,s);if(i.constructor!==Object&&(w=d.get(i.constructor)))return w(i,s);let c={};t.push(i),u.push(c);for(let o in i){let n=i[o];if(typeof n!="object"||n===null)c[o]=n;else if(n.constructor!==Object&&(w=d.get(n.constructor)))c[o]=w(n,s);else if(ArrayBuffer.isView(n))c[o]=k(n);else{let l=t.indexOf(n);l!==-1?c[o]=u[l]:c[o]=s(n)}}return t.pop(),u.pop(),c}}});var ln={};Wr(ln,{deepContains:()=>Fr,defaults:()=>jr,version:()=>pn});var L=W(v(),1);var er=W(G(),1);var tr=W(G(),1);var bn=(0,tr.default)();function nr(r){if(r==null||typeof r!="object")return!1;let t=Object.getPrototypeOf(r);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}function J(r){if(r.includes(".")){let t=r.lastIndexOf(".");if(!r.slice(0,t).includes("."))return r.slice(0,t);for(let u=t-1;u--;)if(r[u]===".")return r.slice(u+1,t)}return null}var g=(0,er.default)();function ir(r,t){let u={now:!1};function d(w,A,a,s){let i=g(w),c,o=T({depth:-1,path:""},a);if(o.depth+=1,Array.isArray(i))for(let n=0,l=i.length;n<l&&!s.now;n++){let S=o.path?"".concat(o.path,".").concat(n):"".concat(n);i[n]!==void 0?(o.parent=g(i),o.parentType="array",o.parentKey=J(S),c=d(A(i[n],void 0,B(T({},o),{path:S}),s),A,B(T({},o),{path:S}),s),Number.isNaN(c)&&n<i.length?(i.splice(n,1),n-=1):i[n]=c):i.splice(n,1)}else if(nr(i))for(let n in i){if(s.now&&n!=null)break;let l=o.path?"".concat(o.path,".").concat(n):n;o.depth===0&&n!=null&&(o.topmostKey=n),o.parent=g(i),o.parentType="object",o.parentKey=J(l),c=d(A(n,i[n],B(T({},o),{path:l}),s),A,B(T({},o),{path:l}),s),Number.isNaN(c)?delete i[n]:i[n]=c}return i}return d(r,t,{},u)}function or(r){return Object.keys(r)}var cr=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Hr(r){return cr.includes(r)}var fr=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...cr];function Kr(r){return fr.includes(r)}var pr=["null","undefined","string","number","bigint","boolean","symbol"];function _r(r){return pr.includes(r)}var Tn=["positive number","negative number","Class","string with a number","null or undefined","Iterable","AsyncIterable","native Promise","EnumCase","string with a URL","truthy","falsy","primitive","integer","plain object","TypedArray","array-like","tuple-like","Node.js Stream","infinite number","empty array","non-empty array","empty string","empty string or whitespace","non-empty string","non-empty string and not whitespace","empty object","non-empty object","empty set","non-empty set","empty map","non-empty map","PropertyKey","even integer","odd integer","T","in range","predicate returns truthy for any value","predicate returns truthy for all values","valid Date","valid length","whitespace string",...fr,...pr],b=r=>{let t=Object.prototype.toString.call(r).slice(8,-1);if(/HTML\w+Element/.test(t)&&wr(r))return"HTMLElement";if(Kr(t))return t};function ur(r){if(r===null)return"null";switch(typeof r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(K(r))return"Observable";if(D(r))return"Array";if(dr(r))return"Buffer";let t=b(r);if(t&&t!=="Object")return t;if(yr(r))return"Promise";if(r instanceof String||r instanceof Boolean||r instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}function yr(r){return $(r==null?void 0:r.then)&&$(r==null?void 0:r.catch)}var Qr=Object.assign(ur,{all:qr,any:lr,array:D,arrayBuffer:Yr,arrayLike:Zr,asyncFunction:Xr,asyncGenerator:vr,asyncGeneratorFunction:rt,asyncIterable:sr,bigint:tt,bigInt64Array:nt,bigUint64Array:et,blob:it,boolean:ot,boundFunction:ut,buffer:dr,class:ct,dataView:ft,date:br,detect:ur,directInstanceOf:pt,emptyArray:yt,emptyMap:at,emptyObject:lt,emptySet:st,emptyString:hr,emptyStringOrWhitespace:H,enumCase:dt,error:bt,evenInteger:ht,falsy:wt,float32Array:At,float64Array:Et,formData:xt,function:$,generator:St,generatorFunction:$t,htmlElement:wr,infinite:Nt,inRange:mt,int16Array:It,int32Array:Dt,int8Array:kt,integer:Ar,iterable:Er,map:C,nan:xr,nativePromise:Sr,negativeNumber:jt,nodeStream:Ft,nonEmptyArray:Bt,nonEmptyMap:Ct,nonEmptyObject:Pt,nonEmptySet:Ut,nonEmptyString:Vt,nonEmptyStringAndNotWhitespace:Mt,null:R,nullOrUndefined:$r,number:P,numericString:Rt,object:U,observable:K,oddInteger:Lt,plainObject:Or,positiveNumber:Wt,primitive:Gt,promise:Jt,propertyKey:gt,regExp:Ht,safeInteger:Tr,set:V,sharedArrayBuffer:Kt,string:N,symbol:Nr,truthy:_t,tupleLike:Qt,typedArray:qt,uint16Array:zt,uint32Array:Yt,uint8Array:Zt,uint8ClampedArray:Xt,undefined:_,urlInstance:vt,urlSearchParams:rn,urlString:tn,optional:zr,validDate:nn,validLength:mr,weakMap:en,weakRef:on,weakSet:un,whitespaceString:Ir});function ar(r){return t=>Ar(t)&&Math.abs(t%2)===r}function qr(r,...t){return Dr(Array.prototype.every,r,t)}function lr(r,...t){return(D(r)?r:[r]).some(d=>Dr(Array.prototype.some,d,t))}function zr(r,t){return _(r)||t(r)}function D(r,t){return Array.isArray(r)?$(t)?r.every(u=>t(u)):!0:!1}function Yr(r){return b(r)==="ArrayBuffer"}function Zr(r){return!$r(r)&&!$(r)&&mr(r.length)}function Xr(r){return b(r)==="AsyncFunction"}function vr(r){return sr(r)&&$(r.next)&&$(r.throw)}function rt(r){return b(r)==="AsyncGeneratorFunction"}function sr(r){return $(r==null?void 0:r[Symbol.asyncIterator])}function tt(r){return typeof r=="bigint"}function nt(r){return b(r)==="BigInt64Array"}function et(r){return b(r)==="BigUint64Array"}function it(r){return b(r)==="Blob"}function ot(r){return r===!0||r===!1}function ut(r){return $(r)&&!Object.hasOwn(r,"prototype")}function dr(r){var t,u,d;return(d=(u=(t=r==null?void 0:r.constructor)==null?void 0:t.isBuffer)==null?void 0:u.call(t,r))!=null?d:!1}function ct(r){return $(r)&&r.toString().startsWith("class ")}function ft(r){return b(r)==="DataView"}function br(r){return b(r)==="Date"}function pt(r,t){return r==null?!1:Object.getPrototypeOf(r)===t.prototype}function yt(r){return D(r)&&r.length===0}function at(r){return C(r)&&r.size===0}function lt(r){return U(r)&&!C(r)&&!V(r)&&Object.keys(r).length===0}function st(r){return V(r)&&r.size===0}function hr(r){return N(r)&&r.length===0}function H(r){return hr(r)||Ir(r)}function dt(r,t){return Object.values(t).includes(r)}function bt(r){return b(r)==="Error"}function ht(r){return ar(0)(r)}function wt(r){return!r}function At(r){return b(r)==="Float32Array"}function Et(r){return b(r)==="Float64Array"}function xt(r){return b(r)==="FormData"}function $(r){return typeof r=="function"}function St(r){return Er(r)&&$(r==null?void 0:r.next)&&$(r==null?void 0:r.throw)}function $t(r){return b(r)==="GeneratorFunction"}var Ot=1,Tt=["innerHTML","ownerDocument","style","attributes","nodeValue"];function wr(r){return U(r)&&r.nodeType===Ot&&N(r.nodeName)&&!Or(r)&&Tt.every(t=>t in r)}function Nt(r){return r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY}function mt(r,t){if(P(t))return r>=Math.min(0,t)&&r<=Math.max(t,0);if(D(t)&&t.length===2)return r>=Math.min(...t)&&r<=Math.max(...t);throw new TypeError("Invalid range: ".concat(JSON.stringify(t)))}function It(r){return b(r)==="Int16Array"}function Dt(r){return b(r)==="Int32Array"}function kt(r){return b(r)==="Int8Array"}function Ar(r){return Number.isInteger(r)}function Er(r){return $(r==null?void 0:r[Symbol.iterator])}function C(r){return b(r)==="Map"}function xr(r){return Number.isNaN(r)}function Sr(r){return b(r)==="Promise"}function jt(r){return P(r)&&r<0}function Ft(r){return U(r)&&$(r.pipe)&&!K(r)}function Bt(r){return D(r)&&r.length>0}function Ct(r){return C(r)&&r.size>0}function Pt(r){return U(r)&&!C(r)&&!V(r)&&Object.keys(r).length>0}function Ut(r){return V(r)&&r.size>0}function Vt(r){return N(r)&&r.length>0}function Mt(r){return N(r)&&!H(r)}function R(r){return r===null}function $r(r){return R(r)||_(r)}function P(r){return typeof r=="number"&&!Number.isNaN(r)}function Rt(r){return N(r)&&!H(r)&&!Number.isNaN(Number(r))}function U(r){return!R(r)&&(typeof r=="object"||$(r))}function K(r){var t,u;return r?Symbol.observable!==void 0&&r===((t=r[Symbol.observable])==null?void 0:t.call(r))||r===((u=r["@@observable"])==null?void 0:u.call(r)):!1}function Lt(r){return ar(1)(r)}function Or(r){if(typeof r!="object"||r===null)return!1;let t=Object.getPrototypeOf(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function Wt(r){return P(r)&&r>0}function Gt(r){return R(r)||_r(typeof r)}function Jt(r){return Sr(r)||yr(r)}function gt(r){return lr([N,P,Nr],r)}function Ht(r){return b(r)==="RegExp"}function Tr(r){return Number.isSafeInteger(r)}function V(r){return b(r)==="Set"}function Kt(r){return b(r)==="SharedArrayBuffer"}function N(r){return typeof r=="string"}function Nr(r){return typeof r=="symbol"}function _t(r){return!!r}function Qt(r,t){return D(t)&&D(r)&&t.length===r.length?t.every((u,d)=>u(r[d])):!1}function qt(r){return Hr(b(r))}function zt(r){return b(r)==="Uint16Array"}function Yt(r){return b(r)==="Uint32Array"}function Zt(r){return b(r)==="Uint8Array"}function Xt(r){return b(r)==="Uint8ClampedArray"}function _(r){return r===void 0}function vt(r){return b(r)==="URL"}function rn(r){return b(r)==="URLSearchParams"}function tn(r){if(!N(r))return!1;try{return new URL(r),!0}catch(t){return!1}}function nn(r){return br(r)&&!xr(Number(r))}function mr(r){return Tr(r)&&r>=0}function en(r){return b(r)==="WeakMap"}function on(r){return b(r)==="WeakRef"}function un(r){return b(r)==="WeakSet"}function Ir(r){return N(r)&&/^\s+$/.test(r)}function Dr(r,t,u){if(!$(t))throw new TypeError("Invalid predicate: ".concat(JSON.stringify(t)));if(u.length===0)throw new TypeError("Invalid number of values");return r.call(u,t)}var Nn=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),mn=new Intl.ListFormat("en",{style:"long",type:"disjunction"});var cn={isArray:"Array",isArrayBuffer:"ArrayBuffer",isArrayLike:"array-like",isAsyncFunction:"AsyncFunction",isAsyncGenerator:"AsyncGenerator",isAsyncGeneratorFunction:"AsyncGeneratorFunction",isAsyncIterable:"AsyncIterable",isBigint:"bigint",isBigInt64Array:"BigInt64Array",isBigUint64Array:"BigUint64Array",isBlob:"Blob",isBoolean:"boolean",isBoundFunction:"Function",isBuffer:"Buffer",isClass:"Class",isDataView:"DataView",isDate:"Date",isDirectInstanceOf:"T",isEmptyArray:"empty array",isEmptyMap:"empty map",isEmptyObject:"empty object",isEmptySet:"empty set",isEmptyString:"empty string",isEmptyStringOrWhitespace:"empty string or whitespace",isEnumCase:"EnumCase",isError:"Error",isEvenInteger:"even integer",isFalsy:"falsy",isFloat32Array:"Float32Array",isFloat64Array:"Float64Array",isFormData:"FormData",isFunction:"Function",isGenerator:"Generator",isGeneratorFunction:"GeneratorFunction",isHtmlElement:"HTMLElement",isInfinite:"infinite number",isInRange:"in range",isInt16Array:"Int16Array",isInt32Array:"Int32Array",isInt8Array:"Int8Array",isInteger:"integer",isIterable:"Iterable",isMap:"Map",isNan:"NaN",isNativePromise:"native Promise",isNegativeNumber:"negative number",isNodeStream:"Node.js Stream",isNonEmptyArray:"non-empty array",isNonEmptyMap:"non-empty map",isNonEmptyObject:"non-empty object",isNonEmptySet:"non-empty set",isNonEmptyString:"non-empty string",isNonEmptyStringAndNotWhitespace:"non-empty string and not whitespace",isNull:"null",isNullOrUndefined:"null or undefined",isNumber:"number",isNumericString:"string with a number",isObject:"Object",isObservable:"Observable",isOddInteger:"odd integer",isPlainObject:"plain object",isPositiveNumber:"positive number",isPrimitive:"primitive",isPromise:"Promise",isPropertyKey:"PropertyKey",isRegExp:"RegExp",isSafeInteger:"integer",isSet:"Set",isSharedArrayBuffer:"SharedArrayBuffer",isString:"string",isSymbol:"symbol",isTruthy:"truthy",isTupleLike:"tuple-like",isTypedArray:"TypedArray",isUint16Array:"Uint16Array",isUint32Array:"Uint32Array",isUint8Array:"Uint8Array",isUint8ClampedArray:"Uint8ClampedArray",isUndefined:"undefined",isUrlInstance:"URL",isUrlSearchParams:"URLSearchParams",isUrlString:"string with a URL",isValidDate:"valid Date",isValidLength:"valid length",isWeakMap:"WeakMap",isWeakRef:"WeakRef",isWeakSet:"WeakSet",isWhitespaceString:"whitespace string"},In=or(cn);var m=Qr;var kr="5.1.0";var pn=kr;function yn(r){if(r.includes(".")){for(let t=r.length;t--;)if(r[t]===".")return r.slice(0,t)}return r}function an(r,t){return Array.from(r).filter((u,d)=>d!==t)}var jr={skipContainers:!0,arrayStrictComparison:!1};function Fr(r,t,u,d,w){let A=T(T({},jr),w);m(r)!==m(t)?d("the first input arg is of a type ".concat(m(r).toLowerCase()," but the second is ").concat(m(t).toLowerCase(),". Values are - 1st:\n").concat(JSON.stringify(r,null,4),"\n2nd:\n").concat(JSON.stringify(t,null,4))):ir(t,(a,s,i,c)=>{let o=s!==void 0?s:a,{path:n}=i;if(L.default.has(r,n))if(!A.arrayStrictComparison&&m.plainObject(o)&&i.parentType==="array"&&i.parent.length>1){c.now=!0;let l=Array.from(i.path.includes(".")?L.default.get(r,yn(n)):r);if(l.length<i.parent.length)d("the first array: ".concat(JSON.stringify(l,null,4),"\nhas less objects than array we're matching against, ").concat(JSON.stringify(i.parent,null,4)));else{let S=i.parent,x=l.map((y,h)=>h),I=S.map((y,h)=>h),p=[];for(let y=0,h=x.length;y<h;y++){let E=[],O=x[y],j=an(x,y);E.push(O),j.forEach(Br=>{p.push(Array.from(E).concat(Br))})}let e=p.map(y=>y.map((h,E)=>[E,h])),f=0;for(let y=0,h=e.length;y<h;y++){let E=0;e[y].forEach(O=>{m.plainObject(S[O[0]])&&m.plainObject(l[O[1]])&&Object.keys(S[O[0]]).forEach(j=>{Object.keys(l[O[1]]).includes(j)&&(E+=1,l[O[1]][j]===S[O[0]][j]&&(E+=5))})}),e[y].push(E),E>f&&(f=E)}for(let y=0,h=e.length;y<h;y++)if(e[y][2]===f){e[y].forEach((E,O)=>{O<e[y].length-1&&Fr(l[E[1]],S[E[0]],u,d,A)});break}}}else{let l=L.default.get(r,n);(!A.skipContainers||!m.plainObject(l)&&!Array.isArray(l))&&u(l,o,n)}else d("the first input: ".concat(JSON.stringify(r,null,4),'\ndoes not have the path "').concat(n,'", we were looking, would it contain a value ').concat(JSON.stringify(o,null,0),"."));return o})}return Gr(ln);})();
|
|
10
|
+
"use strict";var astDeepContains=(()=>{var Cr=Object.create;var j=Object.defineProperty,Ur=Object.defineProperties,Vr=Object.getOwnPropertyDescriptor,Mr=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertyNames,q=Object.getOwnPropertySymbols,Lr=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable;var z=(r,t,u)=>t in r?j(r,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[t]=u,T=(r,t)=>{for(var u in t||(t={}))Y.call(t,u)&&z(r,u,t[u]);if(q)for(var u of q(t))Wr.call(t,u)&&z(r,u,t[u]);return r},B=(r,t)=>Ur(r,Mr(t));var Z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Gr=(r,t)=>{for(var u in t)j(r,u,{get:t[u],enumerable:!0})},X=(r,t,u,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let b of Rr(t))!Y.call(r,b)&&b!==u&&j(r,b,{get:()=>t[b],enumerable:!(s=Vr(t,b))||s.enumerable});return r};var G=(r,t,u)=>(u=r!=null?Cr(Lr(r)):{},X(t||!r||!r.__esModule?j(u,"default",{value:r,enumerable:!0}):u,r)),Jr=r=>X(j({},"__esModule",{value:!0}),r);var rr=Z((v,M)=>{(function(r,t){"use strict";typeof M=="object"&&typeof M.exports=="object"?M.exports=t():typeof define=="function"&&define.amd?define([],t):r.objectPath=t()})(v,function(){"use strict";var r=Object.prototype.toString;function t(o,n){return o==null?!1:Object.prototype.hasOwnProperty.call(o,n)}function u(o){if(!o||A(o)&&o.length===0)return!0;if(typeof o!="string"){for(var n in o)if(t(o,n))return!1;return!0}return!1}function s(o){return r.call(o)}function b(o){return typeof o=="object"&&s(o)==="[object Object]"}var A=Array.isArray||function(o){return r.call(o)==="[object Array]"};function a(o){return typeof o=="boolean"||s(o)==="[object Boolean]"}function d(o){var n=parseInt(o);return n.toString()===o?n:o}function i(o){o=o||{};var n=function(p){return Object.keys(n).reduce(function(e,f){return f==="create"||typeof n[f]=="function"&&(e[f]=n[f].bind(n,p)),e},{})},l;o.includeInheritedProps?l=function(){return!0}:l=function(p,e){return typeof e=="number"&&Array.isArray(p)||t(p,e)};function S(p,e){if(l(p,e))return p[e]}var x;o.includeInheritedProps?x=function(p,e){typeof e!="string"&&typeof e!="number"&&(e=String(e));var f=S(p,e);if(e==="__proto__"||e==="prototype"||e==="constructor"&&typeof f=="function")throw new Error("For security reasons, object's magic properties cannot be set");return f}:x=function(p,e){return S(p,e)};function I(p,e,f,y){if(typeof e=="number"&&(e=[e]),!e||e.length===0)return p;if(typeof e=="string")return I(p,e.split(".").map(d),f,y);var w=e[0],E=x(p,w);return e.length===1?((E===void 0||!y)&&(p[w]=f),E):(E===void 0&&(typeof e[1]=="number"?p[w]=[]:p[w]={}),I(p[w],e.slice(1),f,y))}return n.has=function(p,e){if(typeof e=="number"?e=[e]:typeof e=="string"&&(e=e.split(".")),!e||e.length===0)return!!p;for(var f=0;f<e.length;f++){var y=d(e[f]);if(typeof y=="number"&&A(p)&&y<p.length||(o.includeInheritedProps?y in Object(p):t(p,y)))p=p[y];else return!1}return!0},n.ensureExists=function(p,e,f){return I(p,e,f,!0)},n.set=function(p,e,f,y){return I(p,e,f,y)},n.insert=function(p,e,f,y){var w=n.get(p,e);y=~~y,A(w)||(w=[],n.set(p,e,w)),w.splice(y,0,f)},n.empty=function(p,e){if(!u(e)&&p!=null){var f,y;if(f=n.get(p,e)){if(typeof f=="string")return n.set(p,e,"");if(a(f))return n.set(p,e,!1);if(typeof f=="number")return n.set(p,e,0);if(A(f))f.length=0;else if(b(f))for(y in f)l(f,y)&&delete f[y];else return n.set(p,e,null)}}},n.push=function(p,e){var f=n.get(p,e);A(f)||(f=[],n.set(p,e,f)),f.push.apply(f,Array.prototype.slice.call(arguments,2))},n.coalesce=function(p,e,f){for(var y,w=0,E=e.length;w<E;w++)if((y=n.get(p,e[w]))!==void 0)return y;return f},n.get=function(p,e,f){if(typeof e=="number"&&(e=[e]),!e||e.length===0)return p;if(p==null)return f;if(typeof e=="string")return n.get(p,e.split("."),f);var y=d(e[0]),w=x(p,y);return w===void 0?f:e.length===1?w:n.get(p[y],e.slice(1),f)},n.del=function(e,f){if(typeof f=="number"&&(f=[f]),e==null||u(f))return e;if(typeof f=="string")return n.del(e,f.split("."));var y=d(f[0]);if(x(e,y),!l(e,y))return e;if(f.length===1)A(e)?e.splice(y,1):delete e[y];else return n.del(e[y],f.slice(1));return e},n}var c=i();return c.create=i,c.withInheritedProps=i({includeInheritedProps:!0}),c})});var J=Z((bn,tr)=>{"use strict";tr.exports=gr;function k(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function gr(r){if(r=r||{},r.circles)return Hr(r);let t=new Map;if(t.set(Date,a=>new Date(a)),t.set(Map,(a,d)=>new Map(s(Array.from(a),d))),t.set(Set,(a,d)=>new Set(s(Array.from(a),d))),r.constructorHandlers)for(let a of r.constructorHandlers)t.set(a[0],a[1]);let u=null;return r.proto?A:b;function s(a,d){let i=Object.keys(a),c=new Array(i.length);for(let o=0;o<i.length;o++){let n=i[o],l=a[n];typeof l!="object"||l===null?c[n]=l:l.constructor!==Object&&(u=t.get(l.constructor))?c[n]=u(l,d):ArrayBuffer.isView(l)?c[n]=k(l):c[n]=d(l)}return c}function b(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return s(a,b);if(a.constructor!==Object&&(u=t.get(a.constructor)))return u(a,b);let d={};for(let i in a){if(Object.hasOwnProperty.call(a,i)===!1)continue;let c=a[i];typeof c!="object"||c===null?d[i]=c:c.constructor!==Object&&(u=t.get(c.constructor))?d[i]=u(c,b):ArrayBuffer.isView(c)?d[i]=k(c):d[i]=b(c)}return d}function A(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return s(a,A);if(a.constructor!==Object&&(u=t.get(a.constructor)))return u(a,A);let d={};for(let i in a){let c=a[i];typeof c!="object"||c===null?d[i]=c:c.constructor!==Object&&(u=t.get(c.constructor))?d[i]=u(c,A):ArrayBuffer.isView(c)?d[i]=k(c):d[i]=A(c)}return d}}function Hr(r){let t=[],u=[],s=new Map;if(s.set(Date,i=>new Date(i)),s.set(Map,(i,c)=>new Map(A(Array.from(i),c))),s.set(Set,(i,c)=>new Set(A(Array.from(i),c))),r.constructorHandlers)for(let i of r.constructorHandlers)s.set(i[0],i[1]);let b=null;return r.proto?d:a;function A(i,c){let o=Object.keys(i),n=new Array(o.length);for(let l=0;l<o.length;l++){let S=o[l],x=i[S];if(typeof x!="object"||x===null)n[S]=x;else if(x.constructor!==Object&&(b=s.get(x.constructor)))n[S]=b(x,c);else if(ArrayBuffer.isView(x))n[S]=k(x);else{let I=t.indexOf(x);I!==-1?n[S]=u[I]:n[S]=c(x)}}return n}function a(i){if(typeof i!="object"||i===null)return i;if(Array.isArray(i))return A(i,a);if(i.constructor!==Object&&(b=s.get(i.constructor)))return b(i,a);let c={};t.push(i),u.push(c);for(let o in i){if(Object.hasOwnProperty.call(i,o)===!1)continue;let n=i[o];if(typeof n!="object"||n===null)c[o]=n;else if(n.constructor!==Object&&(b=s.get(n.constructor)))c[o]=b(n,a);else if(ArrayBuffer.isView(n))c[o]=k(n);else{let l=t.indexOf(n);l!==-1?c[o]=u[l]:c[o]=a(n)}}return t.pop(),u.pop(),c}function d(i){if(typeof i!="object"||i===null)return i;if(Array.isArray(i))return A(i,d);if(i.constructor!==Object&&(b=s.get(i.constructor)))return b(i,d);let c={};t.push(i),u.push(c);for(let o in i){let n=i[o];if(typeof n!="object"||n===null)c[o]=n;else if(n.constructor!==Object&&(b=s.get(n.constructor)))c[o]=b(n,d);else if(ArrayBuffer.isView(n))c[o]=k(n);else{let l=t.indexOf(n);l!==-1?c[o]=u[l]:c[o]=d(n)}}return t.pop(),u.pop(),c}}});var sn={};Gr(sn,{deepContains:()=>Br,defaults:()=>jr,version:()=>yn});var W=G(rr(),1);var ir=G(J(),1);var nr=G(J(),1);var hn=(0,nr.default)();function er(r){if(r==null||typeof r!="object")return!1;let t=Object.getPrototypeOf(r);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}function g(r){if(r.includes(".")){let t=r.lastIndexOf(".");if(!r.slice(0,t).includes("."))return r.slice(0,t);for(let u=t-1;u--;)if(r[u]===".")return r.slice(u+1,t)}return null}var H=(0,ir.default)();function or(r,t){let u={now:!1};function s(b,A,a,d){let i=H(b),c,o=T({depth:-1,path:""},a);if(o.depth+=1,Array.isArray(i))for(let n=0,l=i.length;n<l&&!d.now;n++){let S=o.path?"".concat(o.path,".").concat(n):"".concat(n);i[n]!==void 0?(o.parent=H(i),o.parentType="array",o.parentKey=g(S),c=s(A(i[n],void 0,B(T({},o),{path:S}),d),A,B(T({},o),{path:S}),d),Number.isNaN(c)&&n<i.length?(i.splice(n,1),n-=1):i[n]=c):i.splice(n,1)}else if(er(i))for(let n in i){if(d.now&&n!=null)break;let l=o.path?"".concat(o.path,".").concat(n):n;o.depth===0&&n!=null&&(o.topmostKey=n),o.parent=H(i),o.parentType="object",o.parentKey=g(l),c=s(A(n,i[n],B(T({},o),{path:l}),d),A,B(T({},o),{path:l}),d),Number.isNaN(c)?delete i[n]:i[n]=c}return i}return s(r,t,{},u)}function ur(r){return Object.keys(r)}var fr=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Kr(r){return fr.includes(r)}var pr=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...fr];function _r(r){return pr.includes(r)}var yr=["null","undefined","string","number","bigint","boolean","symbol"];function Qr(r){return yr.includes(r)}var Nn=["positive number","negative number","Class","string with a number","null or undefined","Iterable","AsyncIterable","native Promise","EnumCase","string with a URL","truthy","falsy","primitive","integer","plain object","TypedArray","array-like","tuple-like","Node.js Stream","infinite number","empty array","non-empty array","empty string","empty string or whitespace","non-empty string","non-empty string and not whitespace","empty object","non-empty object","empty set","non-empty set","empty map","non-empty map","PropertyKey","even integer","odd integer","T","in range","predicate returns truthy for any value","predicate returns truthy for all values","valid Date","valid length","whitespace string",...pr,...yr],h=r=>{let t=Object.prototype.toString.call(r).slice(8,-1);if(/HTML\w+Element/.test(t)&&Er(r))return"HTMLElement";if(_r(t))return t};function cr(r){if(r===null)return"null";switch(typeof r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(_(r))return"Observable";if(D(r))return"Array";if(hr(r))return"Buffer";let t=h(r);if(t&&t!=="Object")return t;if(ar(r))return"Promise";if(r instanceof String||r instanceof Boolean||r instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}function ar(r){return $(r==null?void 0:r.then)&&$(r==null?void 0:r.catch)}var qr=Object.assign(cr,{all:zr,any:dr,array:D,arrayBuffer:Zr,arrayLike:Xr,asyncFunction:vr,asyncGenerator:rt,asyncGeneratorFunction:tt,asyncIterable:br,bigint:nt,bigInt64Array:et,bigUint64Array:it,blob:ot,boolean:ut,boundFunction:ct,buffer:hr,class:ft,dataView:pt,date:wr,detect:cr,directInstanceOf:yt,emptyArray:at,emptyMap:lt,emptyObject:st,emptySet:dt,emptyString:Ar,emptyStringOrWhitespace:K,enumCase:bt,error:ht,evenInteger:wt,falsy:At,float32Array:Et,float64Array:xt,formData:St,function:$,generator:$t,generatorFunction:Ot,htmlElement:Er,infinite:mt,inRange:It,int16Array:Dt,int32Array:kt,int8Array:Ft,integer:xr,iterable:Sr,map:P,nan:$r,nativePromise:Or,negativeNumber:jt,nodeStream:Bt,nonEmptyArray:Pt,nonEmptyMap:Ct,nonEmptyObject:Ut,nonEmptySet:Vt,nonEmptyString:Mt,nonEmptyStringAndNotWhitespace:Rt,null:L,nullOrUndefined:Tr,number:C,numericString:Lt,object:U,observable:_,oddInteger:Wt,plainObject:Nr,positiveNumber:Gt,primitive:Jt,promise:gt,propertyKey:Ht,regExp:Kt,safeInteger:mr,set:V,sharedArrayBuffer:_t,string:N,symbol:Ir,truthy:Qt,tupleLike:qt,typedArray:zt,uint16Array:Yt,uint32Array:Zt,uint8Array:Xt,uint8ClampedArray:vt,undefined:Q,urlInstance:rn,urlSearchParams:tn,urlString:nn,optional:Yr,validDate:en,validLength:Dr,weakMap:on,weakRef:un,weakSet:cn,whitespaceString:kr});function lr(r){return t=>xr(t)&&Math.abs(t%2)===r}function sr(r,t){if(r.length===0){if(!t)throw new TypeError("Invalid predicate array");return}for(let u of r)if(!$(u))throw new TypeError("Invalid predicate: ".concat(JSON.stringify(u)))}function zr(r,...t){if(Array.isArray(r)){let u=r;sr(u,t.length===0);let s=b=>u.every(A=>A(b));return t.length===0?s:R(Array.prototype.every,s,t)}return R(Array.prototype.every,r,t)}function dr(r,...t){if(Array.isArray(r)){let u=r;sr(u,t.length===0);let s=b=>u.some(A=>A(b));return t.length===0?s:R(Array.prototype.some,s,t)}return R(Array.prototype.some,r,t)}function Yr(r,t){return Q(r)||t(r)}function D(r,t){return Array.isArray(r)?$(t)?r.every(u=>t(u)):!0:!1}function Zr(r){return h(r)==="ArrayBuffer"}function Xr(r){return!Tr(r)&&!$(r)&&Dr(r.length)}function vr(r){return h(r)==="AsyncFunction"}function rt(r){return br(r)&&$(r.next)&&$(r.throw)}function tt(r){return h(r)==="AsyncGeneratorFunction"}function br(r){return $(r==null?void 0:r[Symbol.asyncIterator])}function nt(r){return typeof r=="bigint"}function et(r){return h(r)==="BigInt64Array"}function it(r){return h(r)==="BigUint64Array"}function ot(r){return h(r)==="Blob"}function ut(r){return r===!0||r===!1}function ct(r){return $(r)&&!Object.hasOwn(r,"prototype")}function hr(r){var t,u,s;return(s=(u=(t=r==null?void 0:r.constructor)==null?void 0:t.isBuffer)==null?void 0:u.call(t,r))!=null?s:!1}function ft(r){return $(r)&&/^class(\s+|{)/.test(r.toString())}function pt(r){return h(r)==="DataView"}function wr(r){return h(r)==="Date"}function yt(r,t){return r==null?!1:Object.getPrototypeOf(r)===t.prototype}function at(r){return D(r)&&r.length===0}function lt(r){return P(r)&&r.size===0}function st(r){return U(r)&&!P(r)&&!V(r)&&Object.keys(r).length===0}function dt(r){return V(r)&&r.size===0}function Ar(r){return N(r)&&r.length===0}function K(r){return Ar(r)||kr(r)}function bt(r,t){return Object.values(t).includes(r)}function ht(r){return h(r)==="Error"}function wt(r){return lr(0)(r)}function At(r){return!r}function Et(r){return h(r)==="Float32Array"}function xt(r){return h(r)==="Float64Array"}function St(r){return h(r)==="FormData"}function $(r){return typeof r=="function"}function $t(r){return Sr(r)&&$(r==null?void 0:r.next)&&$(r==null?void 0:r.throw)}function Ot(r){return h(r)==="GeneratorFunction"}var Tt=1,Nt=["innerHTML","ownerDocument","style","attributes","nodeValue"];function Er(r){return U(r)&&r.nodeType===Tt&&N(r.nodeName)&&!Nr(r)&&Nt.every(t=>t in r)}function mt(r){return r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY}function It(r,t){if(C(t))return r>=Math.min(0,t)&&r<=Math.max(t,0);if(D(t)&&t.length===2)return r>=Math.min(...t)&&r<=Math.max(...t);throw new TypeError("Invalid range: ".concat(JSON.stringify(t)))}function Dt(r){return h(r)==="Int16Array"}function kt(r){return h(r)==="Int32Array"}function Ft(r){return h(r)==="Int8Array"}function xr(r){return Number.isInteger(r)}function Sr(r){return $(r==null?void 0:r[Symbol.iterator])}function P(r){return h(r)==="Map"}function $r(r){return Number.isNaN(r)}function Or(r){return h(r)==="Promise"}function jt(r){return C(r)&&r<0}function Bt(r){return U(r)&&$(r.pipe)&&!_(r)}function Pt(r){return D(r)&&r.length>0}function Ct(r){return P(r)&&r.size>0}function Ut(r){return U(r)&&!P(r)&&!V(r)&&Object.keys(r).length>0}function Vt(r){return V(r)&&r.size>0}function Mt(r){return N(r)&&r.length>0}function Rt(r){return N(r)&&!K(r)}function L(r){return r===null}function Tr(r){return L(r)||Q(r)}function C(r){return typeof r=="number"&&!Number.isNaN(r)}function Lt(r){return N(r)&&!K(r)&&!Number.isNaN(Number(r))}function U(r){return!L(r)&&(typeof r=="object"||$(r))}function _(r){var t,u;return r?Symbol.observable!==void 0&&r===((t=r[Symbol.observable])==null?void 0:t.call(r))||r===((u=r["@@observable"])==null?void 0:u.call(r)):!1}function Wt(r){return lr(1)(r)}function Nr(r){if(typeof r!="object"||r===null)return!1;let t=Object.getPrototypeOf(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function Gt(r){return C(r)&&r>0}function Jt(r){return L(r)||Qr(typeof r)}function gt(r){return Or(r)||ar(r)}function Ht(r){return dr([N,C,Ir],r)}function Kt(r){return h(r)==="RegExp"}function mr(r){return Number.isSafeInteger(r)}function V(r){return h(r)==="Set"}function _t(r){return h(r)==="SharedArrayBuffer"}function N(r){return typeof r=="string"}function Ir(r){return typeof r=="symbol"}function Qt(r){return!!r}function qt(r,t){return D(t)&&D(r)&&t.length===r.length?t.every((u,s)=>u(r[s])):!1}function zt(r){return Kr(h(r))}function Yt(r){return h(r)==="Uint16Array"}function Zt(r){return h(r)==="Uint32Array"}function Xt(r){return h(r)==="Uint8Array"}function vt(r){return h(r)==="Uint8ClampedArray"}function Q(r){return r===void 0}function rn(r){return h(r)==="URL"}function tn(r){return h(r)==="URLSearchParams"}function nn(r){if(!N(r))return!1;try{return new URL(r),!0}catch(t){return!1}}function en(r){return wr(r)&&!$r(Number(r))}function Dr(r){return mr(r)&&r>=0}function on(r){return h(r)==="WeakMap"}function un(r){return h(r)==="WeakRef"}function cn(r){return h(r)==="WeakSet"}function kr(r){return N(r)&&/^\s+$/.test(r)}function R(r,t,u){if(!$(t))throw new TypeError("Invalid predicate: ".concat(JSON.stringify(t)));if(u.length===0)throw new TypeError("Invalid number of values");return r.call(u,t)}var mn=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),In=new Intl.ListFormat("en",{style:"long",type:"disjunction"});var fn={isArray:"Array",isArrayBuffer:"ArrayBuffer",isArrayLike:"array-like",isAsyncFunction:"AsyncFunction",isAsyncGenerator:"AsyncGenerator",isAsyncGeneratorFunction:"AsyncGeneratorFunction",isAsyncIterable:"AsyncIterable",isBigint:"bigint",isBigInt64Array:"BigInt64Array",isBigUint64Array:"BigUint64Array",isBlob:"Blob",isBoolean:"boolean",isBoundFunction:"Function",isBuffer:"Buffer",isClass:"Class",isDataView:"DataView",isDate:"Date",isDirectInstanceOf:"T",isEmptyArray:"empty array",isEmptyMap:"empty map",isEmptyObject:"empty object",isEmptySet:"empty set",isEmptyString:"empty string",isEmptyStringOrWhitespace:"empty string or whitespace",isEnumCase:"EnumCase",isError:"Error",isEvenInteger:"even integer",isFalsy:"falsy",isFloat32Array:"Float32Array",isFloat64Array:"Float64Array",isFormData:"FormData",isFunction:"Function",isGenerator:"Generator",isGeneratorFunction:"GeneratorFunction",isHtmlElement:"HTMLElement",isInfinite:"infinite number",isInRange:"in range",isInt16Array:"Int16Array",isInt32Array:"Int32Array",isInt8Array:"Int8Array",isInteger:"integer",isIterable:"Iterable",isMap:"Map",isNan:"NaN",isNativePromise:"native Promise",isNegativeNumber:"negative number",isNodeStream:"Node.js Stream",isNonEmptyArray:"non-empty array",isNonEmptyMap:"non-empty map",isNonEmptyObject:"non-empty object",isNonEmptySet:"non-empty set",isNonEmptyString:"non-empty string",isNonEmptyStringAndNotWhitespace:"non-empty string and not whitespace",isNull:"null",isNullOrUndefined:"null or undefined",isNumber:"number",isNumericString:"string with a number",isObject:"Object",isObservable:"Observable",isOddInteger:"odd integer",isPlainObject:"plain object",isPositiveNumber:"positive number",isPrimitive:"primitive",isPromise:"Promise",isPropertyKey:"PropertyKey",isRegExp:"RegExp",isSafeInteger:"integer",isSet:"Set",isSharedArrayBuffer:"SharedArrayBuffer",isString:"string",isSymbol:"symbol",isTruthy:"truthy",isTupleLike:"tuple-like",isTypedArray:"TypedArray",isUint16Array:"Uint16Array",isUint32Array:"Uint32Array",isUint8Array:"Uint8Array",isUint8ClampedArray:"Uint8ClampedArray",isUndefined:"undefined",isUrlInstance:"URL",isUrlSearchParams:"URLSearchParams",isUrlString:"string with a URL",isValidDate:"valid Date",isValidLength:"valid length",isWeakMap:"WeakMap",isWeakRef:"WeakRef",isWeakSet:"WeakSet",isWhitespaceString:"whitespace string"},Dn=ur(fn);var m=qr;var Fr="5.1.3";var yn=Fr;function an(r){if(r.includes(".")){for(let t=r.length;t--;)if(r[t]===".")return r.slice(0,t)}return r}function ln(r,t){return Array.from(r).filter((u,s)=>s!==t)}var jr={skipContainers:!0,arrayStrictComparison:!1};function Br(r,t,u,s,b){let A=T(T({},jr),b);m(r)!==m(t)?s("the first input arg is of a type ".concat(m(r).toLowerCase()," but the second is ").concat(m(t).toLowerCase(),". Values are - 1st:\n").concat(JSON.stringify(r,null,4),"\n2nd:\n").concat(JSON.stringify(t,null,4))):or(t,(a,d,i,c)=>{let o=d!==void 0?d:a,{path:n}=i;if(W.default.has(r,n))if(!A.arrayStrictComparison&&m.plainObject(o)&&i.parentType==="array"&&i.parent.length>1){c.now=!0;let l=Array.from(i.path.includes(".")?W.default.get(r,an(n)):r);if(l.length<i.parent.length)s("the first array: ".concat(JSON.stringify(l,null,4),"\nhas less objects than array we're matching against, ").concat(JSON.stringify(i.parent,null,4)));else{let S=i.parent,x=l.map((y,w)=>w),I=S.map((y,w)=>w),p=[];for(let y=0,w=x.length;y<w;y++){let E=[],O=x[y],F=ln(x,y);E.push(O),F.forEach(Pr=>{p.push(Array.from(E).concat(Pr))})}let e=p.map(y=>y.map((w,E)=>[E,w])),f=0;for(let y=0,w=e.length;y<w;y++){let E=0;e[y].forEach(O=>{m.plainObject(S[O[0]])&&m.plainObject(l[O[1]])&&Object.keys(S[O[0]]).forEach(F=>{Object.keys(l[O[1]]).includes(F)&&(E+=1,l[O[1]][F]===S[O[0]][F]&&(E+=5))})}),e[y].push(E),E>f&&(f=E)}for(let y=0,w=e.length;y<w;y++)if(e[y][2]===f){e[y].forEach((E,O)=>{O<e[y].length-1&&Br(l[E[1]],S[E[0]],u,s,A)});break}}}else{let l=W.default.get(r,n);(!A.skipContainers||!m.plainObject(l)&&!Array.isArray(l))&&u(l,o,n)}else s("the first input: ".concat(JSON.stringify(r,null,4),'\ndoes not have the path "').concat(n,'", we were looking, would it contain a value ').concat(JSON.stringify(o,null,0),"."));return o})}return Jr(sn);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.7.
|
|
14
|
+
* @version 1.7.3
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name ast-monkey-util
|
|
21
21
|
* @fileoverview Utility library of AST helper functions
|
|
22
|
-
* @version 3.1.
|
|
22
|
+
* @version 3.1.3
|
|
23
23
|
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/**
|
|
28
28
|
* @name ast-monkey-traverse
|
|
29
29
|
* @fileoverview Utility library to traverse AST
|
|
30
|
-
* @version 4.1.
|
|
30
|
+
* @version 4.1.3
|
|
31
31
|
* @author Roy Revelt
|
|
32
32
|
* @license MIT
|
|
33
33
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-deep-contains",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "Like t.same assert on array of objects, where element order doesn't matter.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"various": {}
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@sindresorhus/is": "^7.
|
|
90
|
-
"ast-monkey-traverse": "^4.1.
|
|
89
|
+
"@sindresorhus/is": "^7.2.0",
|
|
90
|
+
"ast-monkey-traverse": "^4.1.3",
|
|
91
91
|
"object-path": "^0.11.8"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
package/.eslintcache
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"/home/runner/work/codsen/codsen/packages/ast-deep-contains/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/ast-deep-contains/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/ast-deep-contains/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/ast-deep-contains/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/ast-deep-contains/test/test.js":"5"},{"size":1163,"mtime":1760566739068,"results":"6","hashOfConfig":"7"},{"size":516,"mtime":1760566739068,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760566739068,"results":"10","hashOfConfig":"7"},{"size":17124,"mtime":1760566739068,"results":"11","hashOfConfig":"9"},{"size":14775,"mtime":1760566739068,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"nrihsz","/home/runner/work/codsen/codsen/packages/ast-deep-contains/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-deep-contains/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-deep-contains/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-deep-contains/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/ast-deep-contains/test/test.js",["29"],["30","31","32","33","34"],{"ruleId":"35","severity":1,"message":"36","line":591,"column":1,"nodeType":"37","messageId":"38","endLine":591,"endColumn":138},{"ruleId":"39","severity":2,"message":"40","line":3,"column":17,"nodeType":null,"messageId":"41","endLine":3,"endColumn":19,"suppressions":"42"},{"ruleId":"39","severity":2,"message":"43","line":3,"column":21,"nodeType":null,"messageId":"41","endLine":3,"endColumn":23,"suppressions":"44"},{"ruleId":"39","severity":2,"message":"45","line":3,"column":25,"nodeType":null,"messageId":"41","endLine":3,"endColumn":31,"suppressions":"46"},{"ruleId":"39","severity":2,"message":"47","line":3,"column":33,"nodeType":null,"messageId":"41","endLine":3,"endColumn":37,"suppressions":"48"},{"ruleId":"39","severity":2,"message":"49","line":3,"column":39,"nodeType":null,"messageId":"41","endLine":3,"endColumn":42,"suppressions":"50"},"jest/no-commented-out-tests","Do not comment out tests","Line","commentedTests","@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["51"],"'ok' is defined but never used.",["52"],"'throws' is defined but never used.",["53"],"'type' is defined but never used.",["54"],"'not' is defined but never used.",["55"],{"kind":"56","justification":"57"},{"kind":"56","justification":"57"},{"kind":"56","justification":"57"},{"kind":"56","justification":"57"},{"kind":"56","justification":"57"},"directive",""]
|