ast-deep-contains 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,11 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## 5.1.0 (2025-10-15)
6
+ ## 5.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - match every object in unordered arrays ([70e67d9](https://github.com/codsen/codsen/commit/70e67d9d786168ce986855ab2a53a76376a9152c))
11
+ - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
7
13
 
8
14
  ### Features
9
15
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
16
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
17
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
18
+
19
+ ### Reverts
20
+
21
+ - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
22
+ - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
11
23
 
12
24
  ## 5.0.0 (2022-12-01)
13
25
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2026 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -32,33 +32,17 @@ npm i ast-deep-contains
32
32
  ## Quick Take
33
33
 
34
34
  ```js
35
- import { strict as assert } from "assert";
35
+ import { strict as assert } from "node:assert";
36
36
 
37
37
  import { deepContains } from "ast-deep-contains";
38
38
 
39
39
  const gathered = [];
40
40
  const errors = [];
41
41
 
42
- const reference = [
43
- { c: "2" }, // will end up not used
44
- { a: "1", b: "2", c: "3" },
45
- { x: "8", y: "9", z: "0" },
46
- ];
47
-
48
- const structureToMatch = [
49
- { a: "1", b: "2", c: "3" }, // matches but has different position in the source
50
- { x: "8", y: "9" }, // "z" missing
51
- ];
52
-
53
- // This program pre-matches first, then matches objects as a set-subset
54
42
  deepContains(
55
- reference,
56
- structureToMatch,
43
+ { title: "Release notes", author: "Ada", draft: false },
44
+ { title: "Release notes", author: "Ada" },
57
45
  (leftSideVal, rightSideVal) => {
58
- // This callback does the pre-matching and picks the key pairs for you.
59
- // It's up to you what you will do with left- and right-side
60
- // values - we normally feed them to unit test asserts but here we just push
61
- // to array:
62
46
  gathered.push([leftSideVal, rightSideVal]);
63
47
  },
64
48
  (err) => {
@@ -66,21 +50,17 @@ deepContains(
66
50
  },
67
51
  );
68
52
 
69
- // imagine instead of pushing pairs into array, you fed them into assert
70
- // function in unit tests:
71
53
  assert.deepEqual(gathered, [
72
- ["1", "1"],
73
- ["2", "2"],
74
- ["3", "3"],
75
- ["8", "8"],
76
- ["9", "9"],
54
+ ["Release notes", "Release notes"],
55
+ ["Ada", "Ada"],
77
56
  ]);
78
57
  assert.equal(errors.length, 0);
79
58
  ```
80
59
 
60
+
81
61
  ## Documentation
82
62
 
83
- Please [visit codsen.com](https://codsen.com/os/ast-deep-contains/) for a full description of the API.
63
+ Please [visit codsen.com](https://codsen.com/os/ast-deep-contains/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/ast-deep-contains/CHANGELOG.md).
84
64
 
85
65
  ## Contributing
86
66
 
@@ -90,6 +70,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
90
70
 
91
71
  MIT License
92
72
 
93
- Copyright © 2010-2025 Roy Revelt and other contributors
73
+ Copyright © 2010-2026 Roy Revelt and other contributors
94
74
 
95
75
  <p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
@@ -1,15 +1,15 @@
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.0
4
+ * @version 5.2.0
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.0";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
- ${JSON.stringify(n,null,4)}
10
+ import{traverse as v}from"ast-monkey-traverse";import w from"object-path";var k="5.2.0";var P=k;function E(e){if(e.includes(".")){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function g(e){if(e===null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function j(e){return e===null?"null":Array.isArray(e)?"array":typeof e=="number"&&Number.isNaN(e)?"nan":typeof e!="object"?typeof e:Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var N={skipContainers:!0,arrayStrictComparison:!1};function x(e,r,c,o,h){let m={...N,...h},d=j(e),l=j(r);d!==l?o(`the first input arg is of a type ${d} but the second is ${l}. Values are - 1st:
11
+ ${JSON.stringify(e,null,4)}
12
12
  2nd:
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)}
14
- has less objects than array we're matching against, ${JSON.stringify(a.parent,null,4)}`);else{let m=a.parent,g=o.map((e,t)=>t),A=m.map((e,t)=>t),S=[];for(let e=0,t=g.length;e<t;e++){let r=[],i=g[e],p=k(g,e);r.push(i),p.forEach(N=>{S.push(Array.from(r).concat(N))})}let u=S.map(e=>e.map((t,r)=>[r,t])),y=0;for(let e=0,t=u.length;e<t;e++){let r=0;u[e].forEach(i=>{l.plainObject(m[i[0]])&&l.plainObject(o[i[1]])&&Object.keys(m[i[0]]).forEach(p=>{Object.keys(o[i[1]]).includes(p)&&(r+=1,o[i[1]][p]===m[i[0]][p]&&(r+=5))})}),u[e].push(r),r>y&&(y=r)}for(let e=0,t=u.length;e<t;e++)if(u[e][2]===y){u[e].forEach((r,i)=>{i<u[e].length-1&&w(o[r[1]],m[r[0]],b,c,f)});break}}}else{let o=h.get(n,$);(!f.skipContainers||!l.plainObject(o)&&!Array.isArray(o))&&b(o,d,$)}else c(`the first input: ${JSON.stringify(n,null,4)}
15
- does not have the path "${$}", we were looking, would it contain a value ${JSON.stringify(d,null,0)}.`);return d})}export{w as deepContains,x as defaults,F as version};
13
+ ${JSON.stringify(r,null,4)}`):v(r,(y,f,t,s)=>{let a=f!==void 0?f:y,{path:u}=t;if(w.has(e,u))if(!m.arrayStrictComparison&&g(a)&&t.parentType==="array"&&t.parent.length>1){s.now=!0;let i=Array.from(t.path.includes(".")?w.get(e,E(u)):e);if(i.length<t.parent.length)o(`the first array: ${JSON.stringify(i,null,4)}
14
+ has less objects than array we're matching against, ${JSON.stringify(t.parent,null,4)}`);else{let p=t.parent,b=I(p,i);for(let[n,$]of b)x(i[$],p[n],c,o,m)}}else{let i=w.get(e,u);(!m.skipContainers||!g(i)&&!Array.isArray(i))&&c(i,a,u)}else o(`the first input: ${JSON.stringify(e,null,4)}
15
+ does not have the path "${u}", we were looking, would it contain a value ${JSON.stringify(a,null,0)}.`);return a})}var S=Object.prototype.hasOwnProperty;function C(e,r){if(!g(e)||!g(r))return 0;let c=0;for(let o of Object.keys(e))S.call(r,o)&&(c+=r[o]===e[o]?6:1);return c}function I(e,r){let c=e.length,o=r.length,h=e.map(t=>r.map(s=>C(t,s))),m=new Array(c+1).fill(0),d=new Array(o+1).fill(0),l=new Array(o+1).fill(0),y=new Array(o+1).fill(0);for(let t=1;t<=c;t++){l[0]=t;let s=0,a=new Array(o+1).fill(Number.POSITIVE_INFINITY),u=new Array(o+1).fill(!1);do{u[s]=!0;let i=l[s],p=Number.POSITIVE_INFINITY,b=0;for(let n=1;n<=o;n++){if(u[n])continue;let $=-h[i-1][n-1]-m[i]-d[n];$<a[n]&&(a[n]=$,y[n]=s),a[n]<p&&(p=a[n],b=n)}for(let n=0;n<=o;n++)u[n]?(m[l[n]]+=p,d[n]-=p):a[n]-=p;s=b}while(l[s]!==0);do{let i=y[s];l[s]=l[i],s=i}while(s!==0)}let f=new Array(c);for(let t=1;t<=o;t++)l[t]>0&&(f[l[t]-1]=t-1);return f.map((t,s)=>[s,t])}export{x as deepContains,N as defaults,P as version};
@@ -1,33 +1,25 @@
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.0
4
+ * @version 5.2.0
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 K=Object.create;var S=Object.defineProperty,H=Object.defineProperties,Q=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertyNames,W=Object.getOwnPropertySymbols,Y=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var N=(e,r,l)=>r in e?S(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l,$=(e,r)=>{for(var l in r||(r={}))T.call(r,l)&&N(e,l,r[l]);if(W)for(var l of W(r))Z.call(r,l)&&N(e,l,r[l]);return e},C=(e,r)=>H(e,G(r));var q=(e,r)=>()=>{try{return r||e((r={exports:{}}).exports,r),r.exports}catch(l){throw r=0,l}},X=(e,r)=>{for(var l in r)S(e,l,{get:r[l],enumerable:!0})},M=(e,r,l,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let g of z(r))!T.call(e,g)&&g!==l&&S(e,g,{get:()=>r[g],enumerable:!(a=Q(r,g))||a.enumerable});return e};var ee=(e,r,l)=>(l=e!=null?K(Y(e)):{},M(r||!e||!e.__esModule?S(l,"default",{value:e,enumerable:!0}):l,e)),te=e=>M(S({},"__esModule",{value:!0}),e);var x=(e,r,l)=>N(e,typeof r!="symbol"?r+"":r,l);var V=q((L,I)=>{(function(e,r){"use strict";typeof I=="object"&&typeof I.exports=="object"?I.exports=r():typeof define=="function"&&define.amd?define([],r):e.objectPath=r()})(L,function(){"use strict";var e=Object.prototype.toString;function r(n,i){return n==null?!1:Object.prototype.hasOwnProperty.call(n,i)}function l(n){if(!n||u(n)&&n.length===0)return!0;if(typeof n!="string"){for(var i in n)if(r(n,i))return!1;return!0}return!1}function a(n){return e.call(n)}function g(n){return typeof n=="object"&&a(n)==="[object Object]"}var u=Array.isArray||function(n){return e.call(n)==="[object Array]"};function m(n){return typeof n=="boolean"||a(n)==="[object Boolean]"}function p(n){var i=parseInt(n);return i.toString()===n?i:n}function c(n){n=n||{};var i=function(o){return Object.keys(i).reduce(function(t,s){return s==="create"||typeof i[s]=="function"&&(t[s]=i[s].bind(i,o)),t},{})},y;n.includeInheritedProps?y=function(){return!0}:y=function(o,t){return typeof t=="number"&&Array.isArray(o)||r(o,t)};function b(o,t){if(y(o,t))return o[t]}var d;n.includeInheritedProps?d=function(o,t){typeof t!="string"&&typeof t!="number"&&(t=String(t));var s=b(o,t);if(t==="__proto__"||t==="prototype"||t==="constructor"&&typeof s=="function")throw new Error("For security reasons, object's magic properties cannot be set");return s}:d=function(o,t){return b(o,t)};function v(o,t,s,f){if(typeof t=="number"&&(t=[t]),!t||t.length===0)return o;if(typeof t=="string")return v(o,t.split(".").map(p),s,f);var w=t[0],k=d(o,w);return t.length===1?((k===void 0||!f)&&(o[w]=s),k):(k===void 0&&(typeof t[1]=="number"?o[w]=[]:o[w]={}),v(o[w],t.slice(1),s,f))}return i.has=function(o,t){if(typeof t=="number"?t=[t]:typeof t=="string"&&(t=t.split(".")),!t||t.length===0)return!!o;for(var s=0;s<t.length;s++){var f=p(t[s]);if(typeof f=="number"&&u(o)&&f<o.length||(n.includeInheritedProps?f in Object(o):r(o,f)))o=o[f];else return!1}return!0},i.ensureExists=function(o,t,s){return v(o,t,s,!0)},i.set=function(o,t,s,f){return v(o,t,s,f)},i.insert=function(o,t,s,f){var w=i.get(o,t);f=~~f,u(w)||(w=[],i.set(o,t,w)),w.splice(f,0,s)},i.empty=function(o,t){if(!l(t)&&o!=null){var s,f;if(s=i.get(o,t)){if(typeof s=="string")return i.set(o,t,"");if(m(s))return i.set(o,t,!1);if(typeof s=="number")return i.set(o,t,0);if(u(s))s.length=0;else if(g(s))for(f in s)y(s,f)&&delete s[f];else return i.set(o,t,null)}}},i.push=function(o,t){var s=i.get(o,t);u(s)||(s=[],i.set(o,t,s)),s.push.apply(s,Array.prototype.slice.call(arguments,2))},i.coalesce=function(o,t,s){for(var f,w=0,k=t.length;w<k;w++)if((f=i.get(o,t[w]))!==void 0)return f;return s},i.get=function(o,t,s){if(typeof t=="number"&&(t=[t]),!t||t.length===0)return o;if(o==null)return s;if(typeof t=="string")return i.get(o,t.split("."),s);var f=p(t[0]),w=d(o,f);return w===void 0?s:t.length===1?w:i.get(o[f],t.slice(1),s)},i.del=function(t,s){if(typeof s=="number"&&(s=[s]),t==null||l(s))return t;if(typeof s=="string")return i.del(t,s.split("."));var f=p(s[0]);if(d(t,f),!y(t,f))return t;if(s.length===1)u(t)?t.splice(f,1):delete t[f];else return i.del(t[f],s.slice(1));return t},i}var h=c();return h.create=c,h.withInheritedProps=c({includeInheritedProps:!0}),h})});var fe={};X(fe,{deepContains:()=>_,defaults:()=>J,version:()=>se});var pe=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"]);var re=class{constructor(){x(this,"hasRepeatedReferences",!1);x(this,"clones",[]);x(this,"index");x(this,"sources",[])}get(e){if(this.index){let l=this.index.get(e);return l!==void 0&&(this.hasRepeatedReferences=!0),l}let r=this.sources.indexOf(e);if(r!==-1)return this.hasRepeatedReferences=!0,this.clones[r]}set(e,r){if(this.index){this.index.set(e,r);return}if(this.sources.push(e),this.clones.push(r),this.sources.length===32){this.index=new WeakMap;for(let l=0;l<this.sources.length;l++)this.index.set(this.sources[l],this.clones[l]);this.sources=[],this.clones=[]}}};function j(e,r){let l=r.get(e);if(l!==void 0)return l;let a=e.slice(0);return r.set(e,a),a}function ne(e,r){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let u=Buffer.from(e);return r.set(e,u),u}let l=j(e.buffer,r);if(e instanceof DataView){let u=new DataView(l,e.byteOffset,e.byteLength);return r.set(e,u),u}let a=e.constructor,g=new a(l,e.byteOffset,e.length);return r.set(e,g),g}function P(e,r,l,a){for(let g of l){let u=r[g];e[g]=typeof u!="object"||u===null?u:A(u,a)}}function A(e,r){if(typeof e!="object"||e===null)return e;let l=r.get(e);if(l!==void 0)return l;if(Array.isArray(e)){let u=e.length,m=new Array(u);r.set(e,m);let p=e,c=Object.keys(e);if(c.length===u&&(u===0||c[u-1]==="".concat(u-1)))for(let h=0;h<u;h++){let n=p[h];m[h]=typeof n!="object"||n===null?n:A(n,r)}else P(m,p,c,r);return m}let a=Object.getPrototypeOf(e);if(a===Object.prototype||a===null){let u={};return r.set(e,u),P(u,e,Object.keys(e),r),u}if(e instanceof Date){let u=new Date(e.getTime());return r.set(e,u),u}if(ArrayBuffer.isView(e))return ne(e,r);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return j(e,r);if(e instanceof Map){let u=new Map;r.set(e,u);for(let[m,p]of e)u.set(A(m,r),A(p,r));return u}if(e instanceof Set){let u=new Set;r.set(e,u);for(let m of e)u.add(A(m,r));return u}let g={};return r.set(e,g),P(g,e,Object.keys(e),r),g}function O(e){return A(e,new re)}function B(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function R(e,r){if(typeof r!="function")throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ".concat(typeof r,"."));let l={now:!1};function a(g,u,m,p){let c=g,h,n=$({depth:-1,path:""},m);if(n.depth+=1,Array.isArray(c))for(let i=0,y=c.length;i<y&&!p.now;i++){let b=n.path?"".concat(n.path,".").concat(i):"".concat(i);if(c[i]!==void 0){n.parent=O(c),n.parentType="array",n.parentKey=n.path?n.path.slice(n.path.lastIndexOf(".")+1):null;let d=c[i],v=u(d,void 0,C($({},n),{path:b}),p);h=a(v===d?v:O(v),u,C($({},n),{path:b}),p),Number.isNaN(h)&&i<c.length?(c.splice(i,1),i-=1):c[i]=h}else c.splice(i,1)}else if(B(c))for(let i in c){if(p.now&&i!=null)break;let y=n.path?"".concat(n.path,".").concat(i):i;n.depth===0&&i!=null&&(n.topmostKey=i),n.parent=O(c),n.parentType="object",n.parentKey=n.path?n.path.slice(n.path.lastIndexOf(".")+1):null;let b=c[i],d=u(i,b,C($({},n),{path:y}),p);h=a(d===b?d:O(d),u,C($({},n),{path:y}),p),Number.isNaN(h)?delete c[i]:c[i]=h}return c}return a(O(e),r,{},l)}var D=ee(V(),1);var U="5.2.0";var se=U;function oe(e){if(e.includes(".")){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function E(e){if(e===null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function F(e){return e===null?"null":Array.isArray(e)?"array":typeof e=="number"&&Number.isNaN(e)?"nan":typeof e!="object"?typeof e:Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var J={skipContainers:!0,arrayStrictComparison:!1};function _(e,r,l,a,g){let u=$($({},J),g),m=F(e),p=F(r);m!==p?a("the first input arg is of a type ".concat(m," but the second is ").concat(p,". Values are - 1st:\n").concat(JSON.stringify(e,null,4),"\n2nd:\n").concat(JSON.stringify(r,null,4))):R(r,(c,h,n,i)=>{let y=h!==void 0?h:c,{path:b}=n;if(D.default.has(e,b))if(!u.arrayStrictComparison&&E(y)&&n.parentType==="array"&&n.parent.length>1){i.now=!0;let d=Array.from(n.path.includes(".")?D.default.get(e,oe(b)):e);if(d.length<n.parent.length)a("the first array: ".concat(JSON.stringify(d,null,4),"\nhas less objects than array we're matching against, ").concat(JSON.stringify(n.parent,null,4)));else{let v=n.parent,o=ae(v,d);for(let[t,s]of o)_(d[s],v[t],l,a,u)}}else{let d=D.default.get(e,b);(!u.skipContainers||!E(d)&&!Array.isArray(d))&&l(d,y,b)}else a("the first input: ".concat(JSON.stringify(e,null,4),'\ndoes not have the path "').concat(b,'", we were looking, would it contain a value ').concat(JSON.stringify(y,null,0),"."));return y})}var le=Object.prototype.hasOwnProperty;function ue(e,r){if(!E(e)||!E(r))return 0;let l=0;for(let a of Object.keys(e))le.call(r,a)&&(l+=r[a]===e[a]?6:1);return l}function ae(e,r){let l=e.length,a=r.length,g=e.map(n=>r.map(i=>ue(n,i))),u=new Array(l+1).fill(0),m=new Array(a+1).fill(0),p=new Array(a+1).fill(0),c=new Array(a+1).fill(0);for(let n=1;n<=l;n++){p[0]=n;let i=0,y=new Array(a+1).fill(Number.POSITIVE_INFINITY),b=new Array(a+1).fill(!1);do{b[i]=!0;let d=p[i],v=Number.POSITIVE_INFINITY,o=0;for(let t=1;t<=a;t++){if(b[t])continue;let s=-g[d-1][t-1]-u[d]-m[t];s<y[t]&&(y[t]=s,c[t]=i),y[t]<v&&(v=y[t],o=t)}for(let t=0;t<=a;t++)b[t]?(u[p[t]]+=v,m[t]-=v):y[t]-=v;i=o}while(p[i]!==0);do{let d=c[i];p[i]=p[d],i=d}while(i!==0)}let h=new Array(l);for(let n=1;n<=a;n++)p[n]>0&&(h[p[n]-1]=n-1);return h.map((n,i)=>[i,n])}return te(fe);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.7.0
14
+ * @version 1.8.0
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/codsen-utils/}
18
18
  */
19
- /**
20
- * @name ast-monkey-util
21
- * @fileoverview Utility library of AST helper functions
22
- * @version 3.1.0
23
- * @author Roy Revelt
24
- * @license MIT
25
- * {@link https://codsen.com/os/ast-monkey-util/}
26
- */
27
19
  /**
28
20
  * @name ast-monkey-traverse
29
21
  * @fileoverview Utility library to traverse AST
30
- * @version 4.1.0
22
+ * @version 4.2.0
31
23
  * @author Roy Revelt
32
24
  * @license MIT
33
25
  * {@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.0",
3
+ "version": "5.2.0",
4
4
  "description": "Like t.same assert on array of objects, where element order doesn't matter.",
5
5
  "keywords": [
6
6
  "array",
@@ -49,47 +49,45 @@
49
49
  },
50
50
  "types": "types/index.d.ts",
51
51
  "scripts": {
52
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
53
- "cjs-off": "exit 0",
54
- "cjs-on": "exit 0",
55
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
52
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
53
+ "coverage": "c8 uvu test",
54
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
56
55
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
57
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
56
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
58
57
  "examples": "node '../../ops/scripts/run-examples.js'",
59
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
60
- "letspublish": "npm publish --provenance || :",
61
- "lint": "eslint . --fix --concurrency=auto --cache",
58
+ "lect": "node '../../ops/lect/lect.js'",
59
+ "lect:check": "node '../../ops/lect/lect.js' --check",
60
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
61
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
62
62
  "perf": "node perf/check.js",
63
63
  "prep": "echo 'ready'",
64
- "prettier": "prettier",
65
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
66
- "pretest": "npm run lect && npm run build",
64
+ "prettier": "biome format",
65
+ "prettier:format": "biome format --write .",
66
+ "pretest": "npm run lect:check && npm run build",
67
67
  "test": "npm run devtest",
68
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
68
69
  "unit": "uvu test"
69
70
  },
70
- "engines": {
71
- "node": ">=14.18.0"
72
- },
73
71
  "c8": {
72
+ "all": true,
74
73
  "check-coverage": true,
75
- "exclude": [
76
- "**/test/**/*.*"
77
- ],
74
+ "exclude": ["**/test/**/*.*"],
75
+ "include": ["dist/*.esm.js"],
78
76
  "lines": 100
79
77
  },
80
78
  "lect": {
81
79
  "licence": {
82
- "extras": [
83
- ""
84
- ]
80
+ "extras": [""]
85
81
  },
86
82
  "various": {}
87
83
  },
88
84
  "dependencies": {
89
- "@sindresorhus/is": "^7.1.0",
90
- "ast-monkey-traverse": "^4.1.0",
85
+ "ast-monkey-traverse": "^4.2.0",
91
86
  "object-path": "^0.11.8"
92
87
  },
88
+ "engines": {
89
+ "node": ">=18.20.8"
90
+ },
93
91
  "publishConfig": {
94
92
  "registry": "https://registry.npmjs.org/"
95
93
  }
package/types/index.d.ts CHANGED
@@ -4,12 +4,8 @@ interface Opts {
4
4
  arrayStrictComparison: boolean;
5
5
  }
6
6
  declare const defaults: Opts;
7
- interface Callback {
8
- (leftSideVal: any, rightSideVal: any, path: string): void;
9
- }
10
- interface ErrorCallback {
11
- (errStr: string): void;
12
- }
7
+ type Callback = (leftSideVal: any, rightSideVal: any, path: string) => void;
8
+ type ErrorCallback = (errStr: string) => void;
13
9
  /**
14
10
  * Like t.same assert on array of objects, where element order doesn't matter.
15
11
  */
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",""]