ast-compare 4.1.3 → 4.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,25 @@
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
- ## 4.1.0 (2025-10-15)
6
+ ## 4.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - repair representative perf workloads ([975e958](https://github.com/codsen/codsen/commit/975e958c0794ec256eba84e088b472483fb69e52))
11
+ - require every wildard object key to match ([b6ab279](https://github.com/codsen/codsen/commit/b6ab2795ac11715ea142c74268c550ef443757c8))
12
+ - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
13
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
7
14
 
8
15
  ### Features
9
16
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
17
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
18
+ - add unordered array comparison ([eca419f](https://github.com/codsen/codsen/commit/eca419f33e13e1242f0b5cd98b44233a6e03c561))
19
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
20
+
21
+ ### Reverts
22
+
23
+ - 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)
24
+ - 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
25
 
12
26
  ## 4.0.0 (2022-12-01)
13
27
 
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,7 +32,7 @@ npm i ast-compare
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 { compare } from "ast-compare";
38
38
 
@@ -58,9 +58,10 @@ assert.equal(
58
58
  );
59
59
  ```
60
60
 
61
+
61
62
  ## Documentation
62
63
 
63
- Please [visit codsen.com](https://codsen.com/os/ast-compare/) for a full description of the API.
64
+ Please [visit codsen.com](https://codsen.com/os/ast-compare/) 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-compare/CHANGELOG.md).
64
65
 
65
66
  ## Contributing
66
67
 
@@ -70,6 +71,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
70
71
 
71
72
  MIT License
72
73
 
73
- Copyright © 2010-2025 Roy Revelt and other contributors
74
+ Copyright © 2010-2026 Roy Revelt and other contributors
74
75
 
75
76
  <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,11 +1,11 @@
1
1
  /**
2
2
  * @name ast-compare
3
3
  * @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
4
- * @version 4.1.3
4
+ * @version 4.2.0
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-compare/}
8
8
  */
9
9
 
10
- import i from"type-detect";import{empty as s}from"ast-contains-only-empty-space";import{isPlainObject as o,hasOwnProp as O}from"codsen-utils";import{isMatch as m}from"matcher";var f="4.1.3";var J=f;function V(e){return o(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var j={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function d(e,t,b){let c,u,h,g=0,r={...j,...b};if(r.hungryForWhitespace&&r.matchStrictly&&o(e)&&s(e)&&o(t)&&!Object.keys(t).length)return!0;if((!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)&&s(t))&&o(e)&&Object.keys(e).length!==0&&o(t)&&Object.keys(t).length===0||i(e)!==i(t)&&(!r.hungryForWhitespace||r.hungryForWhitespace&&!s(e)))return!1;if(typeof e=="string"&&typeof t=="string")return r.hungryForWhitespace&&s(e)&&s(t)?!0:r.verboseWhenMismatches?e===t?!0:`Given string ${t} is not matched! We have ${e} on the other end.`:r.useWildcards?m(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(r.hungryForWhitespace&&s(t)&&(!r.matchStrictly||r.matchStrictly&&e.length===t.length))return!0;if(!r.hungryForWhitespace&&t.length>e.length||r.matchStrictly&&t.length!==e.length)return r.verboseWhenMismatches?`The length of a given array, ${JSON.stringify(t,null,4)} is ${t.length} but the length of an array on the other end, ${JSON.stringify(e,null,4)} is ${e.length}`:!1;if(t.length===0)return e.length===0?!0:r.verboseWhenMismatches?`The given array has no elements, but the array on the other end, ${JSON.stringify(e,null,4)} does have some`:!1;for(let n=0,a=t.length;n<a;n++){h=!1;for(let l=g,y=e.length;l<y;l++)if(g+=1,d(e[l],t[n],r)===!0){h=!0;break}if(!h)return r.verboseWhenMismatches?`The given array ${JSON.stringify(t,null,4)} is not a subset of an array on the other end, ${JSON.stringify(e,null,4)}`:!1}}else if(o(e)&&o(t)){if(c=new Set(Object.keys(t)),u=new Set(Object.keys(e)),r.matchStrictly&&c.size!==u.size){if(!r.verboseWhenMismatches)return!1;let n=new Set([...c].filter(p=>!u.has(p))),a=n.size?` First object has unique keys: ${JSON.stringify(n,null,4)}.`:"",l=new Set([...u].filter(p=>!c.has(p))),y=l.size?` Second object has unique keys:
11
- ${JSON.stringify(l,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${a}${y}`}for(let n of c){if(!O(e,n))return!r.useWildcards||r.useWildcards&&!n.includes("*")?r.verboseWhenMismatches?`The given object has key "${n}" which the other-one does not have.`:!1:Object.keys(e).some(a=>m(a,n,{caseSensitive:!0}))?!0:r.verboseWhenMismatches?`The given object has key "${n}" which the other-one does not have.`:!1;if(e[n]!=null&&i(e[n])!==i(t[n])){if(!(s(e[n])&&s(t[n])&&r.hungryForWhitespace))return r.verboseWhenMismatches?`The given key ${n} is of a different type on both objects. On the first-one, it's ${i(t[n])}, on the second-one, it's ${i(e[n])}`:!1}else if(d(e[n],t[n],r)!==!0)return r.verboseWhenMismatches?`The given piece ${JSON.stringify(t[n],null,4)} and ${JSON.stringify(e[n],null,4)} don't match.`:!1}}else return r.hungryForWhitespace&&s(e)&&s(t)&&(!r.matchStrictly||r.matchStrictly&&V(t))?!0:e===t;return!0}export{d as compare,j as defaults,J as version};
10
+ import{empty as l}from"ast-contains-only-empty-space";import{hasOwnProp as D,isPlainObject as c,match as d}from"codsen-utils";var p="4.2.0";var x=p;function j(e){return c(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}function b(e,n){return e===null||n===null?e===n:Array.isArray(e)||Array.isArray(n)?Array.isArray(e)&&Array.isArray(n):typeof e==typeof n}function $(e){return e===null?"null":Array.isArray(e)?"Array":c(e)?"Object":typeof e}var S={arrayOrder:"ordered",hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function w(e,n,t){return f(e,n,{...S,...t})}function f(e,n,t){let u,h,i,y=0;if(t.hungryForWhitespace&&t.matchStrictly&&c(e)&&l(e)&&c(n)&&!Object.keys(n).length)return!0;if((!t.hungryForWhitespace||t.hungryForWhitespace&&!l(e)&&l(n))&&c(e)&&Object.keys(e).length!==0&&c(n)&&Object.keys(n).length===0||!b(e,n)&&(!t.hungryForWhitespace||t.hungryForWhitespace&&!l(e)))return!1;if(typeof e=="string"&&typeof n=="string"){if(t.hungryForWhitespace&&l(e)&&l(n))return!0;let r=t.useWildcards?d(e,n,{caseSensitiveMatch:!0}):e===n;return t.verboseWhenMismatches?r?!0:`Given string ${n} is not matched! We have ${e} on the other end.`:r}if(Array.isArray(e)&&Array.isArray(n)){if(t.hungryForWhitespace&&l(n)&&(!t.matchStrictly||t.matchStrictly&&e.length===n.length))return!0;if(!t.hungryForWhitespace&&n.length>e.length||t.matchStrictly&&n.length!==e.length)return t.verboseWhenMismatches?`The length of a given array, ${JSON.stringify(n,null,4)} is ${n.length} but the length of an array on the other end, ${JSON.stringify(e,null,4)} is ${e.length}`:!1;if(n.length===0)return e.length===0?!0:t.verboseWhenMismatches?`The given array has no elements, but the array on the other end, ${JSON.stringify(e,null,4)} does have some`:!1;if(t.arrayOrder==="any")i=W(e,n,t);else{i=!0;for(let r=0,s=n.length;r<s;r++){i=!1;for(let o=y,a=e.length;o<a;o++)if(y+=1,f(e[o],n[r],t)===!0){i=!0;break}if(!i)break}}if(!i)return t.verboseWhenMismatches?`The given array ${JSON.stringify(n,null,4)} is not a subset of an array on the other end, ${JSON.stringify(e,null,4)}`:!1}else if(c(e)&&c(n)){if(u=Object.keys(n),h=Object.keys(e),t.matchStrictly&&u.length!==h.length){if(!t.verboseWhenMismatches)return!1;let r=new Set(u),s=new Set(h),o=u.filter(g=>!s.has(g)),a=o.length?` First object has unique keys: ${JSON.stringify(o,null,4)}.`:"",m=h.filter(g=>!r.has(g)),V=m.length?` Second object has unique keys:
11
+ ${JSON.stringify(m,null,4)}.`:"";return`When matching strictly, we found that both objects have different amount of keys.${a}${V}`}for(let r of u){if(!D(e,r)){if(!t.useWildcards||t.useWildcards&&!r.includes("*"))return t.verboseWhenMismatches?`The given object has key "${r}" which the other-one does not have.`:!1;if(h.some(s=>d(s,r,{caseSensitiveMatch:!0})))continue;return t.verboseWhenMismatches?`The given object has key "${r}" which the other-one does not have.`:!1}if(e[r]!=null&&!b(e[r],n[r])){if(!(l(e[r])&&l(n[r])&&t.hungryForWhitespace))return t.verboseWhenMismatches?`The given key ${r} is of a different type on both objects. On the first-one, it's ${$(n[r])}, on the second-one, it's ${$(e[r])}`:!1}else if(f(e[r],n[r],t)!==!0)return t.verboseWhenMismatches?`The given piece ${JSON.stringify(n[r],null,4)} and ${JSON.stringify(e[r],null,4)} don't match.`:!1}}else return t.hungryForWhitespace&&l(e)&&l(n)&&(!t.matchStrictly||t.matchStrictly&&j(n))?!0:e===n;return!0}function W(e,n,t){let u=t.verboseWhenMismatches?{...t,verboseWhenMismatches:!1}:t,h=Array.from({length:n.length},(r,s)=>Array.from({length:e.length},(o,a)=>f(e[a],n[s],u)===!0)),i=new Array(e.length).fill(-1);function y(r,s){for(let o=0;o<e.length;o++){if(!h[r][o]||s[o])continue;s[o]=!0;let a=i[o];if(a===-1||y(a,s))return i[o]=r,!0}return!1}for(let r=0;r<n.length;r++)if(!y(r,new Array(e.length).fill(!1)))return!1;return!0}export{w as compare,S as defaults,x as version};
@@ -1,42 +1,26 @@
1
1
  /**
2
2
  * @name ast-compare
3
3
  * @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
4
- * @version 4.1.3
4
+ * @version 4.2.0
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-compare/}
8
8
  */
9
9
 
10
- "use strict";var astCompare=(()=>{var ae=Object.create,J=Object.freeze,v=Object.defineProperty,le=Object.defineProperties,ce=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertyNames,I=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var F=(e,t,i)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))_.call(t,i)&&F(e,i,t[i]);if(I)for(var i of I(t))ye.call(t,i)&&F(e,i,t[i]);return e},w=(e,t)=>le(e,ue(t));var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ge=(e,t)=>{for(var i in t)v(e,i,{get:t[i],enumerable:!0})},R=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of fe(t))!_.call(e,u)&&u!==i&&v(e,u,{get:()=>t[u],enumerable:!(c=ce(t,u))||c.enumerable});return e};var x=(e,t,i)=>(i=e!=null?ae(pe(e)):{},R(t||!e||!e.__esModule?v(i,"default",{value:e,enumerable:!0}):i,e)),he=e=>R(v({},"__esModule",{value:!0}),e);var j=(e,t)=>J(v(e,"raw",{value:J(t||e.slice())}));var H=K((V,k)=>{(function(e,t){typeof V=="object"&&typeof k<"u"?k.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=t())})(V,(function(){"use strict";var e=typeof Promise=="function",t=(function(y){if(typeof globalThis=="object")return globalThis;Object.defineProperty(y,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var $=typeDetectGlobalObject;return delete y.typeDetectGlobalObject,$})(Object.prototype),i=typeof Symbol<"u",c=typeof Map<"u",u=typeof Set<"u",f=typeof WeakMap<"u",l=typeof WeakSet<"u",n=typeof DataView<"u",r=i&&typeof Symbol.iterator<"u",o=i&&typeof Symbol.toStringTag<"u",a=u&&typeof Set.prototype.entries=="function",s=c&&typeof Map.prototype.entries=="function",p=a&&Object.getPrototypeOf(new Set().entries()),d=s&&Object.getPrototypeOf(new Map().entries()),g=r&&typeof Array.prototype[Symbol.iterator]=="function",E=g&&Object.getPrototypeOf([][Symbol.iterator]()),L=r&&typeof String.prototype[Symbol.iterator]=="function",ne=L&&Object.getPrototypeOf(""[Symbol.iterator]()),oe=8,se=-1;function ie(y){var $=typeof y;if($!=="object")return $;if(y===null)return"null";if(y===t)return"global";if(Array.isArray(y)&&(o===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var D=o&&y[Symbol.toStringTag];if(typeof D=="string")return D;var h=Object.getPrototypeOf(y);return h===RegExp.prototype?"RegExp":h===Date.prototype?"Date":e&&h===Promise.prototype?"Promise":u&&h===Set.prototype?"Set":c&&h===Map.prototype?"Map":l&&h===WeakSet.prototype?"WeakSet":f&&h===WeakMap.prototype?"WeakMap":n&&h===DataView.prototype?"DataView":c&&h===d?"Map Iterator":u&&h===p?"Set Iterator":g&&h===E?"Array Iterator":L&&h===ne?"String Iterator":h===null?"Object":Object.prototype.toString.call(y).slice(oe,se)}return ie}))});var T=K((je,Q)=>{"use strict";Q.exports=de;function S(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function de(e){if(e=e||{},e.circles)return me(e);let t=new Map;if(t.set(Date,l=>new Date(l)),t.set(Map,(l,n)=>new Map(c(Array.from(l),n))),t.set(Set,(l,n)=>new Set(c(Array.from(l),n))),e.constructorHandlers)for(let l of e.constructorHandlers)t.set(l[0],l[1]);let i=null;return e.proto?f:u;function c(l,n){let r=Object.keys(l),o=new Array(r.length);for(let a=0;a<r.length;a++){let s=r[a],p=l[s];typeof p!="object"||p===null?o[s]=p:p.constructor!==Object&&(i=t.get(p.constructor))?o[s]=i(p,n):ArrayBuffer.isView(p)?o[s]=S(p):o[s]=n(p)}return o}function u(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return c(l,u);if(l.constructor!==Object&&(i=t.get(l.constructor)))return i(l,u);let n={};for(let r in l){if(Object.hasOwnProperty.call(l,r)===!1)continue;let o=l[r];typeof o!="object"||o===null?n[r]=o:o.constructor!==Object&&(i=t.get(o.constructor))?n[r]=i(o,u):ArrayBuffer.isView(o)?n[r]=S(o):n[r]=u(o)}return n}function f(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return c(l,f);if(l.constructor!==Object&&(i=t.get(l.constructor)))return i(l,f);let n={};for(let r in l){let o=l[r];typeof o!="object"||o===null?n[r]=o:o.constructor!==Object&&(i=t.get(o.constructor))?n[r]=i(o,f):ArrayBuffer.isView(o)?n[r]=S(o):n[r]=f(o)}return n}}function me(e){let t=[],i=[],c=new Map;if(c.set(Date,r=>new Date(r)),c.set(Map,(r,o)=>new Map(f(Array.from(r),o))),c.set(Set,(r,o)=>new Set(f(Array.from(r),o))),e.constructorHandlers)for(let r of e.constructorHandlers)c.set(r[0],r[1]);let u=null;return e.proto?n:l;function f(r,o){let a=Object.keys(r),s=new Array(a.length);for(let p=0;p<a.length;p++){let d=a[p],g=r[d];if(typeof g!="object"||g===null)s[d]=g;else if(g.constructor!==Object&&(u=c.get(g.constructor)))s[d]=u(g,o);else if(ArrayBuffer.isView(g))s[d]=S(g);else{let E=t.indexOf(g);E!==-1?s[d]=i[E]:s[d]=o(g)}}return s}function l(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return f(r,l);if(r.constructor!==Object&&(u=c.get(r.constructor)))return u(r,l);let o={};t.push(r),i.push(o);for(let a in r){if(Object.hasOwnProperty.call(r,a)===!1)continue;let s=r[a];if(typeof s!="object"||s===null)o[a]=s;else if(s.constructor!==Object&&(u=c.get(s.constructor)))o[a]=u(s,l);else if(ArrayBuffer.isView(s))o[a]=S(s);else{let p=t.indexOf(s);p!==-1?o[a]=i[p]:o[a]=l(s)}}return t.pop(),i.pop(),o}function n(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return f(r,n);if(r.constructor!==Object&&(u=c.get(r.constructor)))return u(r,n);let o={};t.push(r),i.push(o);for(let a in r){let s=r[a];if(typeof s!="object"||s===null)o[a]=s;else if(s.constructor!==Object&&(u=c.get(s.constructor)))o[a]=u(s,n);else if(ArrayBuffer.isView(s))o[a]=S(s);else{let p=t.indexOf(s);p!==-1?o[a]=i[p]:o[a]=n(s)}}return t.pop(),i.pop(),o}}});var Ee={};ge(Ee,{compare:()=>B,defaults:()=>re,version:()=>Se});var A=x(H(),1);var z=x(T(),1);var q=x(T(),1);var De=(0,q.default)();function O(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function be(e){return typeof e=="string"}function U(e,t){return O(e)&&be(t)&&t in e}function M(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let i=t-1;i--;)if(e[i]===".")return e.slice(i+1,t)}return null}var C=(0,z.default)();function G(e,t){let i={now:!1};function c(u,f,l,n){let r=C(u),o,a=b({depth:-1,path:""},l);if(a.depth+=1,Array.isArray(r))for(let s=0,p=r.length;s<p&&!n.now;s++){let d=a.path?"".concat(a.path,".").concat(s):"".concat(s);r[s]!==void 0?(a.parent=C(r),a.parentType="array",a.parentKey=M(d),o=c(f(r[s],void 0,w(b({},a),{path:d}),n),f,w(b({},a),{path:d}),n),Number.isNaN(o)&&s<r.length?(r.splice(s,1),s-=1):r[s]=o):r.splice(s,1)}else if(O(r))for(let s in r){if(n.now&&s!=null)break;let p=a.path?"".concat(a.path,".").concat(s):s;a.depth===0&&s!=null&&(a.topmostKey=s),a.parent=C(r),a.parentType="object",a.parentKey=M(p),o=c(f(s,r[s],w(b({},a),{path:p}),n),f,w(b({},a),{path:p}),n),Number.isNaN(o)?delete r[s]:r[s]=o}return r}return c(e,t,{},i)}function m(e){if(typeof e=="string")return!e.trim();if(!["object","string"].includes(typeof e)||!e)return!1;let t=!0;return e=G(e,(i,c,u,f)=>{let l=c!==void 0?c:i;return typeof l=="string"&&l.trim()&&(t=!1,f.now=!0),l}),t}function P(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var W=new Map,Z=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(i=>{if(typeof i!="string"){if(i===void 0)return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof i,"' in the array"))}return!0})},X,Y,ee,Oe=(e,t)=>{t=b({caseSensitive:!1},t);let i="s"+(t.caseSensitive?"":"i"),c=e+"|"+i;if(W.has(c))return W.get(c);let u=e[0]==="!";u&&(e=e.slice(1)),e=e.replaceAll(String.raw(X||(X=j(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=P(e).replaceAll(String.raw(Y||(Y=j(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(ee||(ee=j(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let f=new RegExp("^".concat(e,"$"),i);return f.negated=u,W.set(c,f),f},Ae=(e,t,i,c)=>{if(e=Z(e,"inputs"),t=Z(t,"patterns"),t.length===0)return[];t=t.map(r=>Oe(r,i));let u=t.filter(r=>r.negated),f=t.filter(r=>!r.negated),{allPatterns:l}=i||{},n=[];if(l&&c&&u.length>1&&f.length===0){for(let r of e)for(let o of u)if(o.test(r))return[];return e.slice(0,1)}for(let r of e){let o=!1;for(let a of u)if(a.test(r)){o=!0;break}if(!o){if(f.length===0)n.push(r);else if(l){let a=Array.from({length:f.length},()=>!1);for(let[s,p]of f.entries())p.test(r)&&(a[s]=!0);a.every(Boolean)&&n.push(r)}else{let a=!1;for(let s of f)if(s.test(r)){a=!0;break}a&&n.push(r)}if(c&&n.length>0)break}}return n};function N(e,t,i){return Ae(e,t,i,!0).length>0}var te="4.1.3";var Se=te;function we(e){return O(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var re={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function B(e,t,i){let c,u,f,l=0,n=b(b({},re),i);if(n.hungryForWhitespace&&n.matchStrictly&&O(e)&&m(e)&&O(t)&&!Object.keys(t).length)return!0;if((!n.hungryForWhitespace||n.hungryForWhitespace&&!m(e)&&m(t))&&O(e)&&Object.keys(e).length!==0&&O(t)&&Object.keys(t).length===0||(0,A.default)(e)!==(0,A.default)(t)&&(!n.hungryForWhitespace||n.hungryForWhitespace&&!m(e)))return!1;if(typeof e=="string"&&typeof t=="string")return n.hungryForWhitespace&&m(e)&&m(t)?!0:n.verboseWhenMismatches?e===t?!0:"Given string ".concat(t," is not matched! We have ").concat(e," on the other end."):n.useWildcards?N(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(n.hungryForWhitespace&&m(t)&&(!n.matchStrictly||n.matchStrictly&&e.length===t.length))return!0;if(!n.hungryForWhitespace&&t.length>e.length||n.matchStrictly&&t.length!==e.length)return n.verboseWhenMismatches?"The length of a given array, ".concat(JSON.stringify(t,null,4)," is ").concat(t.length," but the length of an array on the other end, ").concat(JSON.stringify(e,null,4)," is ").concat(e.length):!1;if(t.length===0)return e.length===0?!0:n.verboseWhenMismatches?"The given array has no elements, but the array on the other end, ".concat(JSON.stringify(e,null,4)," does have some"):!1;for(let r=0,o=t.length;r<o;r++){f=!1;for(let a=l,s=e.length;a<s;a++)if(l+=1,B(e[a],t[r],n)===!0){f=!0;break}if(!f)return n.verboseWhenMismatches?"The given array ".concat(JSON.stringify(t,null,4)," is not a subset of an array on the other end, ").concat(JSON.stringify(e,null,4)):!1}}else if(O(e)&&O(t)){if(c=new Set(Object.keys(t)),u=new Set(Object.keys(e)),n.matchStrictly&&c.size!==u.size){if(!n.verboseWhenMismatches)return!1;let r=new Set([...c].filter(p=>!u.has(p))),o=r.size?" First object has unique keys: ".concat(JSON.stringify(r,null,4),"."):"",a=new Set([...u].filter(p=>!c.has(p))),s=a.size?" Second object has unique keys:\n ".concat(JSON.stringify(a,null,4),"."):"";return"When matching strictly, we found that both objects have different amount of keys.".concat(o).concat(s)}for(let r of c){if(!U(e,r))return!n.useWildcards||n.useWildcards&&!r.includes("*")?n.verboseWhenMismatches?'The given object has key "'.concat(r,'" which the other-one does not have.'):!1:Object.keys(e).some(o=>N(o,r,{caseSensitive:!0}))?!0:n.verboseWhenMismatches?'The given object has key "'.concat(r,'" which the other-one does not have.'):!1;if(e[r]!=null&&(0,A.default)(e[r])!==(0,A.default)(t[r])){if(!(m(e[r])&&m(t[r])&&n.hungryForWhitespace))return n.verboseWhenMismatches?"The given key ".concat(r," is of a different type on both objects. On the first-one, it's ").concat((0,A.default)(t[r]),", on the second-one, it's ").concat((0,A.default)(e[r])):!1}else if(B(e[r],t[r],n)!==!0)return n.verboseWhenMismatches?"The given piece ".concat(JSON.stringify(t[r],null,4)," and ").concat(JSON.stringify(e[r],null,4)," don't match."):!1}}else return n.hungryForWhitespace&&m(e)&&m(t)&&(!n.matchStrictly||n.matchStrictly&&we(t))?!0:e===t;return!0}return he(Ee);})();
10
+ "use strict";var astCompare=(()=>{var v=Object.defineProperty,_=Object.defineProperties,Q=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var C=(e,t,r)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))M.call(t,r)&&C(e,r,t[r]);if(O)for(var r of O(t))z.call(t,r)&&C(e,r,t[r]);return e},F=(e,t)=>_(e,H(t));var Z=(e,t)=>{for(var r in t)v(e,r,{get:t[r],enumerable:!0})},Y=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of G(t))!M.call(e,s)&&s!==r&&v(e,s,{get:()=>t[s],enumerable:!(i=Q(t,s))||i.enumerable});return e};var X=e=>Y(v({},"__esModule",{value:!0}),e);var be={};Z(be,{compare:()=>de,defaults:()=>q,version:()=>ge});function ee(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function E(e){if(typeof e=="string")return!e.trim();if(Array.isArray(e)){for(let t of e)if(!E(t))return!1}else if(ee(e)){for(let t of Object.keys(e))if(!E(e[t]))return!1}return!0}function h(e){return typeof e=="string"?!e.trim():typeof e!="object"||!e?!1:E(e)}var Se=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"]),te=Object.prototype.hasOwnProperty;function g(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function re(e){return typeof e=="string"}function N(e,t){return g(e)&&re(t)&&te.call(e,t)}var ne=256,ie=1024,oe=1,se=new Map,le=new Map;function V(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let r=t.charCodeAt(0);return e>127&&r<128?e:r}function W(e,t,r,i,s,o){for(let l=0;l<s;l++){let n=e.charCodeAt(t+l),u=r.charCodeAt(i+l);if(o||(n>=97&&n<=122&&(n-=32),u>=97&&u<=122&&(u-=32)),n!==u)return!1}return!0}function B(e,t,r){let i=t.indexOf("\\");if(i===-1&&e===t)return!0;let s=t.indexOf("*");if(i===-1&&s===-1){if(r)return!1;for(let f=0;f<t.length;f++)if(t.charCodeAt(f)>127)return;return e.length===t.length&&W(e,0,t,0,t.length,!1)}if(i!==-1)return;let o=0,l=!1,n=-1;for(let f=0;f<t.length;f++){let m=t.charCodeAt(f);if(m>127)return;if(m===42){if(n=f,!l){if(o++,o>1)return;l=!0}}else l=!1}let u=n+1,a=t.length-u;return e.length<s+a?!1:W(e,0,t,0,s,r)&&W(e,e.length-a,t,u,a,r)}function ue(e){let t=new Uint32Array(e.length),r=0;for(let i=1;i<e.length;i++){for(;r>0&&e[i]!==e[r];)r=t[r-1];e[i]===e[r]&&r++,t[i]=r}return t}function ae(e,t){let r=[[]],i=!0,s=!1,o=!1,l=0;for(let c=0;c<e.length;){let y=e.codePointAt(c);if(y!==92){if(y===42)s=!0,o||(r.push([]),o=!0);else{let d=t?y:V(y);r[r.length-1].push(d),i&&(i=d<=127),l++,o=!1}c+=y>65535?2:1;continue}let b=c+1;for(;e.charCodeAt(b)===92;)b++;let A=b-c,p=e.codePointAt(b),$,j=!1;p===42?(j=A%2===0,$=j?A/2:(A-1)/2):p===void 0||p===10||p===13||p===8232||p===8233?$=Math.ceil(A/2):$=Math.floor(A/2);for(let d=0;d<$;d++)r[r.length-1].push(92),l++;if(j){o=!1,c=b;continue}if(p!==void 0){let d=t?p:V(p);r[r.length-1].push(d),i&&(i=d<=127),l++,b+=p>65535?2:1}o=!1,c=b}let n=s&&r[0].length===0,u=s&&r[r.length-1].length===0,a=[];for(let c of r)c.length&&a.push({values:c});let f=n?0:1,m=a.length-(u?0:1);for(let c=f;c<m;c++)a[c].values.length>oe&&(a[c].failure=ue(a[c].values));return{asciiOnly:i,endsWithWildcard:u,hasWildcard:s,minimumInputLength:l,segments:a,startsWithWildcard:n}}function I(e,t){let r=t?se:le,i=e.length<=ie;if(i){let o=r.get(e);if(o)return o}let s=ae(e,t);if(i){if(r.size>=ne){let o=r.keys().next().value;o!==void 0&&r.delete(o)}r.set(e,s)}return s}function L(e,t){if(t){let s=[];for(let o=0;o<e.length;){let l=e.codePointAt(o);s.push(l),o+=l>65535?2:1}return s}let r=new Uint32Array(e.length),i=0;for(let s=0;s<e.length;){let o=e.codePointAt(s);r[i]=V(o),i++,s+=o>65535?2:1}return i===r.length?r:r.subarray(0,i)}function D(e,t,r,i){for(let s=0;s<r.values.length;s++){let o=e.charCodeAt(t+s);if(!i&&o>=97&&o<=122&&(o-=32),o!==r.values[s])return!1}return!0}function fe(e,t,r,i,s){let o=i-t.values.length;if(o<r)return-1;if(!t.failure){for(let n=r;n<=o;n++)if(D(e,n,t,s))return n;return-1}let l=0;for(let n=r;n<i;n++){let u=e.charCodeAt(n);for(!s&&u>=97&&u<=122&&(u-=32);l>0&&u!==t.values[l];)l=t.failure[l-1];if(u===t.values[l]&&(l++,l===t.values.length))return n-l+1}return-1}function R(e,t,r){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&D(e,0,t.segments[0],r);let i=0,s=t.segments.length,o=0,l=e.length;if(!t.startsWithWildcard){let n=t.segments[0];if(!D(e,0,n,r))return!1;o=n.values.length,i++}if(!t.endsWithWildcard){s--;let n=t.segments[s];if(l-=n.values.length,!D(e,l,n,r))return!1}for(let n=i;n<s;n++){let u=t.segments[n],a=fe(e,u,o,l,r);if(a===-1)return!1;o=a+u.values.length}return!0}function w(e,t,r){for(let i=0;i<r.values.length;i++)if(e[t+i]!==r.values[i])return!1;return!0}function ce(e,t,r,i){let s=i-t.values.length;if(s<r)return-1;if(!t.failure){for(let l=r;l<=s;l++)if(w(e,l,t))return l;return-1}let o=0;for(let l=r;l<i;l++){for(;o>0&&e[l]!==t.values[o];)o=t.failure[o-1];if(e[l]===t.values[o]&&(o++,o===t.values.length))return l-o+1}return-1}function T(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&w(e,0,t.segments[0]);let r=0,i=t.segments.length,s=0,o=e.length;if(!t.startsWithWildcard){let l=t.segments[0];if(!w(e,0,l))return!1;s=l.values.length,r++}if(!t.endsWithWildcard){i--;let l=t.segments[i];if(o-=l.values.length,!w(e,o,l))return!1}for(let l=r;l<i;l++){let n=t.segments[l],u=ce(e,n,s,o);if(u===-1)return!1;s=u+n.values.length}return!0}function he(e,t,r){let i=B(e,t,r);if(i!==void 0)return i;let s=I(t,r);return s.asciiOnly?R(e,s,r):T(L(e,r),s)}function J(e,t,r,i){var l;let s=B(e,t,r);if(s!==void 0)return s;let o=I(t,r);return o.asciiOnly?R(e,o,r):((l=i.tokens)!=null||(i.tokens=L(e,r)),T(i.tokens,o))}function x(e,t,r){if(typeof t!="string"&&!t.length)return!1;let i=r===void 0?!1:r.caseSensitiveMatch===!0;if(typeof t=="string"){let n=t.charCodeAt(0)===33,u=n?t.slice(1):t,a=he(e,u,i);return n?!a:a}let s={},o=!1,l=!1;for(let n of t){let u=n.charCodeAt(0)===33,a=u?n.slice(1):n;if(u){if(J(e,a,i,s))return!1}else o=!0,!l&&J(e,a,i,s)&&(l=!0)}return o?l:!0}var P="4.2.0";var ge=P;function ye(e){return g(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}function K(e,t){return e===null||t===null?e===t:Array.isArray(e)||Array.isArray(t)?Array.isArray(e)&&Array.isArray(t):typeof e==typeof t}function U(e){return e===null?"null":Array.isArray(e)?"Array":g(e)?"Object":typeof e}var q={arrayOrder:"ordered",hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function de(e,t,r){return k(e,t,S(S({},q),r))}function k(e,t,r){let i,s,o,l=0;if(r.hungryForWhitespace&&r.matchStrictly&&g(e)&&h(e)&&g(t)&&!Object.keys(t).length)return!0;if((!r.hungryForWhitespace||r.hungryForWhitespace&&!h(e)&&h(t))&&g(e)&&Object.keys(e).length!==0&&g(t)&&Object.keys(t).length===0||!K(e,t)&&(!r.hungryForWhitespace||r.hungryForWhitespace&&!h(e)))return!1;if(typeof e=="string"&&typeof t=="string"){if(r.hungryForWhitespace&&h(e)&&h(t))return!0;let n=r.useWildcards?x(e,t,{caseSensitiveMatch:!0}):e===t;return r.verboseWhenMismatches?n?!0:"Given string ".concat(t," is not matched! We have ").concat(e," on the other end."):n}if(Array.isArray(e)&&Array.isArray(t)){if(r.hungryForWhitespace&&h(t)&&(!r.matchStrictly||r.matchStrictly&&e.length===t.length))return!0;if(!r.hungryForWhitespace&&t.length>e.length||r.matchStrictly&&t.length!==e.length)return r.verboseWhenMismatches?"The length of a given array, ".concat(JSON.stringify(t,null,4)," is ").concat(t.length," but the length of an array on the other end, ").concat(JSON.stringify(e,null,4)," is ").concat(e.length):!1;if(t.length===0)return e.length===0?!0:r.verboseWhenMismatches?"The given array has no elements, but the array on the other end, ".concat(JSON.stringify(e,null,4)," does have some"):!1;if(r.arrayOrder==="any")o=me(e,t,r);else{o=!0;for(let n=0,u=t.length;n<u;n++){o=!1;for(let a=l,f=e.length;a<f;a++)if(l+=1,k(e[a],t[n],r)===!0){o=!0;break}if(!o)break}}if(!o)return r.verboseWhenMismatches?"The given array ".concat(JSON.stringify(t,null,4)," is not a subset of an array on the other end, ").concat(JSON.stringify(e,null,4)):!1}else if(g(e)&&g(t)){if(i=Object.keys(t),s=Object.keys(e),r.matchStrictly&&i.length!==s.length){if(!r.verboseWhenMismatches)return!1;let n=new Set(i),u=new Set(s),a=i.filter(y=>!u.has(y)),f=a.length?" First object has unique keys: ".concat(JSON.stringify(a,null,4),"."):"",m=s.filter(y=>!n.has(y)),c=m.length?" Second object has unique keys:\n ".concat(JSON.stringify(m,null,4),"."):"";return"When matching strictly, we found that both objects have different amount of keys.".concat(f).concat(c)}for(let n of i){if(!N(e,n)){if(!r.useWildcards||r.useWildcards&&!n.includes("*"))return r.verboseWhenMismatches?'The given object has key "'.concat(n,'" which the other-one does not have.'):!1;if(s.some(u=>x(u,n,{caseSensitiveMatch:!0})))continue;return r.verboseWhenMismatches?'The given object has key "'.concat(n,'" which the other-one does not have.'):!1}if(e[n]!=null&&!K(e[n],t[n])){if(!(h(e[n])&&h(t[n])&&r.hungryForWhitespace))return r.verboseWhenMismatches?"The given key ".concat(n," is of a different type on both objects. On the first-one, it's ").concat(U(t[n]),", on the second-one, it's ").concat(U(e[n])):!1}else if(k(e[n],t[n],r)!==!0)return r.verboseWhenMismatches?"The given piece ".concat(JSON.stringify(t[n],null,4)," and ").concat(JSON.stringify(e[n],null,4)," don't match."):!1}}else return r.hungryForWhitespace&&h(e)&&h(t)&&(!r.matchStrictly||r.matchStrictly&&ye(t))?!0:e===t;return!0}function me(e,t,r){let i=r.verboseWhenMismatches?F(S({},r),{verboseWhenMismatches:!1}):r,s=Array.from({length:t.length},(n,u)=>Array.from({length:e.length},(a,f)=>k(e[f],t[u],i)===!0)),o=new Array(e.length).fill(-1);function l(n,u){for(let a=0;a<e.length;a++){if(!s[n][a]||u[a])continue;u[a]=!0;let f=o[a];if(f===-1||l(f,u))return o[a]=n,!0}return!1}for(let n=0;n<t.length;n++)if(!l(n,new Array(e.length).fill(!1)))return!1;return!0}return X(be);})();
11
11
  /**
12
- * @name codsen-utils
13
- * @fileoverview Various utility functions
14
- * @version 1.7.3
15
- * @author Roy Revelt
16
- * @license MIT
17
- * {@link https://codsen.com/os/codsen-utils/}
18
- */
19
- /**
20
- * @name ast-monkey-util
21
- * @fileoverview Utility library of AST helper functions
22
- * @version 3.1.3
23
- * @author Roy Revelt
24
- * @license MIT
25
- * {@link https://codsen.com/os/ast-monkey-util/}
26
- */
27
- /**
28
- * @name ast-monkey-traverse
29
- * @fileoverview Utility library to traverse AST
30
- * @version 4.1.3
12
+ * @name ast-contains-only-empty-space
13
+ * @fileoverview Does AST contain only empty space?
14
+ * @version 4.2.0
31
15
  * @author Roy Revelt
32
16
  * @license MIT
33
- * {@link https://codsen.com/os/ast-monkey-traverse/}
17
+ * {@link https://codsen.com/os/ast-contains-only-empty-space/}
34
18
  */
35
19
  /**
36
- * @name ast-contains-only-empty-space
37
- * @fileoverview Does AST contain only empty space?
38
- * @version 4.1.3
20
+ * @name codsen-utils
21
+ * @fileoverview Various utility functions
22
+ * @version 1.8.0
39
23
  * @author Roy Revelt
40
24
  * @license MIT
41
- * {@link https://codsen.com/os/ast-contains-only-empty-space/}
25
+ * {@link https://codsen.com/os/codsen-utils/}
42
26
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-compare",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "description": "Compare anything: AST, objects, arrays, strings and nested thereof",
5
5
  "keywords": [
6
6
  "array",
@@ -41,50 +41,46 @@
41
41
  },
42
42
  "types": "types/index.d.ts",
43
43
  "scripts": {
44
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
45
- "cjs-off": "exit 0",
46
- "cjs-on": "exit 0",
47
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
44
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
45
+ "coverage": "c8 uvu test",
46
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
48
47
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
49
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
48
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
50
49
  "examples": "node '../../ops/scripts/run-examples.js'",
51
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
52
- "letspublish": "npm publish --provenance || :",
53
- "lint": "eslint . --fix --concurrency=auto --cache",
50
+ "lect": "node '../../ops/lect/lect.js'",
51
+ "lect:check": "node '../../ops/lect/lect.js' --check",
52
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
53
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
54
54
  "perf": "node perf/check.js",
55
55
  "prep": "echo 'ready'",
56
- "prettier": "prettier",
57
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
58
- "pretest": "npm run lect && npm run build",
56
+ "prettier": "biome format",
57
+ "prettier:format": "biome format --write .",
58
+ "pretest": "npm run lect:check && npm run build",
59
59
  "test": "npm run devtest",
60
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
60
61
  "unit": "uvu test"
61
62
  },
62
- "engines": {
63
- "node": ">=14.18.0"
64
- },
65
63
  "c8": {
64
+ "all": true,
65
+ "branches": 100,
66
66
  "check-coverage": true,
67
- "exclude": [
68
- "**/test/**/*.*"
69
- ],
70
- "lines": 100
67
+ "exclude": ["**/test/**/*.*"],
68
+ "functions": 100,
69
+ "include": ["dist/*.esm.js"],
70
+ "lines": 100,
71
+ "statements": 100
71
72
  },
72
73
  "lect": {
73
74
  "licence": {
74
- "extras": [
75
- ""
76
- ]
75
+ "extras": [""]
77
76
  }
78
77
  },
79
78
  "dependencies": {
80
- "ast-contains-only-empty-space": "^4.1.3",
81
- "codsen-utils": "^1.7.3",
82
- "matcher": "^6.0.0",
83
- "type-detect": "^4.1.0"
79
+ "ast-contains-only-empty-space": "^4.2.0",
80
+ "codsen-utils": "^1.8.0"
84
81
  },
85
- "devDependencies": {
86
- "@types/type-detect": "^4.0.3",
87
- "type-fest": "^5.4.1"
82
+ "engines": {
83
+ "node": ">=18.20.8"
88
84
  },
89
85
  "publishConfig": {
90
86
  "registry": "https://registry.npmjs.org/"
package/types/index.d.ts CHANGED
@@ -8,6 +8,7 @@ interface AnyObject {
8
8
  [key: string]: any;
9
9
  }
10
10
  interface Opts {
11
+ arrayOrder: "ordered" | "any";
11
12
  hungryForWhitespace: boolean;
12
13
  matchStrictly: boolean;
13
14
  verboseWhenMismatches: boolean;