ast-monkey-traverse 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,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
- ## 4.1.0 (2025-10-15)
6
+ ## 4.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - preserve traversal inputs and validate callbacks ([661d6cb](https://github.com/codsen/codsen/commit/661d6cbb644ce0d58a697a3e04753a2175494094))
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
  ## 4.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,7 +32,7 @@ npm i ast-monkey-traverse
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 { traverse } from "ast-monkey-traverse";
38
38
 
@@ -74,6 +74,7 @@ traverse(source, (key, val, innerObj) => {
74
74
  assert.deepEqual(paths, ["a.foo", "a.foo.bar.0.foo", "a.foo.d.e.foo"]);
75
75
  ```
76
76
 
77
+
77
78
  ## Documentation
78
79
 
79
80
  Please [visit codsen.com](https://codsen.com/os/ast-monkey-traverse/) 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-monkey-traverse/CHANGELOG.md).
@@ -86,6 +87,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
86
87
 
87
88
  MIT License
88
89
 
89
- Copyright © 2010-2025 Roy Revelt and other contributors
90
+ Copyright © 2010-2026 Roy Revelt and other contributors
90
91
 
91
92
  <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,10 +1,10 @@
1
1
  /**
2
2
  * @name ast-monkey-traverse
3
3
  * @fileoverview Utility library to traverse AST
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-monkey-traverse/}
8
8
  */
9
9
 
10
- import h from"rfdc";import{isPlainObject as f}from"codsen-utils";import{parent as m}from"ast-monkey-util";var u="4.1.3";var a=h(),D=u;function k(c,$){let b={now:!1};function i(d,l,y,r){let n=a(d),s,t={depth:-1,path:"",...y};if(t.depth+=1,Array.isArray(n))for(let e=0,o=n.length;e<o&&!r.now;e++){let p=t.path?`${t.path}.${e}`:`${e}`;n[e]!==void 0?(t.parent=a(n),t.parentType="array",t.parentKey=m(p),s=i(l(n[e],void 0,{...t,path:p},r),l,{...t,path:p},r),Number.isNaN(s)&&e<n.length?(n.splice(e,1),e-=1):n[e]=s):n.splice(e,1)}else if(f(n))for(let e in n){if(r.now&&e!=null)break;let o=t.path?`${t.path}.${e}`:e;t.depth===0&&e!=null&&(t.topmostKey=e),t.parent=a(n),t.parentType="object",t.parentKey=m(o),s=i(l(e,n[e],{...t,path:o},r),l,{...t,path:o},r),Number.isNaN(s)?delete n[e]:n[e]=s}return n}return i(c,$,{},b)}export{k as traverse,D as version};
10
+ import{deepClone as i,isPlainObject as g}from"codsen-utils";var b="4.2.0";var O=b;function E(d,c){if(typeof c!="function")throw new TypeError(`ast-monkey-traverse/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ${typeof c}.`);let y={now:!1};function u($,a,h,r){let n=$,s,e={depth:-1,path:"",...h};if(e.depth+=1,Array.isArray(n))for(let t=0,p=n.length;t<p&&!r.now;t++){let l=e.path?`${e.path}.${t}`:`${t}`;if(n[t]!==void 0){e.parent=i(n),e.parentType="array",e.parentKey=e.path?e.path.slice(e.path.lastIndexOf(".")+1):null;let o=n[t],m=a(o,void 0,{...e,path:l},r);s=u(m===o?m:i(m),a,{...e,path:l},r),Number.isNaN(s)&&t<n.length?(n.splice(t,1),t-=1):n[t]=s}else n.splice(t,1)}else if(g(n))for(let t in n){if(r.now&&t!=null)break;let p=e.path?`${e.path}.${t}`:t;e.depth===0&&t!=null&&(e.topmostKey=t),e.parent=i(n),e.parentType="object",e.parentKey=e.path?e.path.slice(e.path.lastIndexOf(".")+1):null;let l=n[t],o=a(t,l,{...e,path:p},r);s=u(o===l?o:i(o),a,{...e,path:p},r),Number.isNaN(s)?delete n[t]:n[t]=s}return n}return u(i(d),c,{},y)}export{E as traverse,O as version};
@@ -1,26 +1,18 @@
1
1
  /**
2
2
  * @name ast-monkey-traverse
3
3
  * @fileoverview Utility library to traverse AST
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-monkey-traverse/}
8
8
  */
9
9
 
10
- "use strict";var astMonkeyTraverse=(()=>{var I=Object.create;var g=Object.defineProperty,T=Object.defineProperties,V=Object.getOwnPropertyDescriptor,P=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertyNames,w=Object.getOwnPropertySymbols,K=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var v=(r,t,i)=>t in r?g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[t]=i,b=(r,t)=>{for(var i in t||(t={}))x.call(t,i)&&v(r,i,t[i]);if(w)for(var i of w(t))M.call(t,i)&&v(r,i,t[i]);return r},h=(r,t)=>T(r,P(t));var F=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),L=(r,t)=>{for(var i in t)g(r,i,{get:t[i],enumerable:!0})},S=(r,t,i,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of R(t))!x.call(r,c)&&c!==i&&g(r,c,{get:()=>t[c],enumerable:!(f=V(t,c))||f.enumerable});return r};var k=(r,t,i)=>(i=r!=null?I(K(r)):{},S(t||!r||!r.__esModule?g(i,"default",{value:r,enumerable:!0}):i,r)),U=r=>S(g({},"__esModule",{value:!0}),r);var $=F((z,D)=>{"use strict";D.exports=J;function y(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function J(r){if(r=r||{},r.circles)return H(r);let t=new Map;if(t.set(Date,o=>new Date(o)),t.set(Map,(o,l)=>new Map(f(Array.from(o),l))),t.set(Set,(o,l)=>new Set(f(Array.from(o),l))),r.constructorHandlers)for(let o of r.constructorHandlers)t.set(o[0],o[1]);let i=null;return r.proto?p:c;function f(o,l){let e=Object.keys(o),s=new Array(e.length);for(let u=0;u<e.length;u++){let n=e[u],a=o[n];typeof a!="object"||a===null?s[n]=a:a.constructor!==Object&&(i=t.get(a.constructor))?s[n]=i(a,l):ArrayBuffer.isView(a)?s[n]=y(a):s[n]=l(a)}return s}function c(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return f(o,c);if(o.constructor!==Object&&(i=t.get(o.constructor)))return i(o,c);let l={};for(let e in o){if(Object.hasOwnProperty.call(o,e)===!1)continue;let s=o[e];typeof s!="object"||s===null?l[e]=s:s.constructor!==Object&&(i=t.get(s.constructor))?l[e]=i(s,c):ArrayBuffer.isView(s)?l[e]=y(s):l[e]=c(s)}return l}function p(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return f(o,p);if(o.constructor!==Object&&(i=t.get(o.constructor)))return i(o,p);let l={};for(let e in o){let s=o[e];typeof s!="object"||s===null?l[e]=s:s.constructor!==Object&&(i=t.get(s.constructor))?l[e]=i(s,p):ArrayBuffer.isView(s)?l[e]=y(s):l[e]=p(s)}return l}}function H(r){let t=[],i=[],f=new Map;if(f.set(Date,e=>new Date(e)),f.set(Map,(e,s)=>new Map(p(Array.from(e),s))),f.set(Set,(e,s)=>new Set(p(Array.from(e),s))),r.constructorHandlers)for(let e of r.constructorHandlers)f.set(e[0],e[1]);let c=null;return r.proto?l:o;function p(e,s){let u=Object.keys(e),n=new Array(u.length);for(let a=0;a<u.length;a++){let d=u[a],m=e[d];if(typeof m!="object"||m===null)n[d]=m;else if(m.constructor!==Object&&(c=f.get(m.constructor)))n[d]=c(m,s);else if(ArrayBuffer.isView(m))n[d]=y(m);else{let O=t.indexOf(m);O!==-1?n[d]=i[O]:n[d]=s(m)}}return n}function o(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,o);if(e.constructor!==Object&&(c=f.get(e.constructor)))return c(e,o);let s={};t.push(e),i.push(s);for(let u in e){if(Object.hasOwnProperty.call(e,u)===!1)continue;let n=e[u];if(typeof n!="object"||n===null)s[u]=n;else if(n.constructor!==Object&&(c=f.get(n.constructor)))s[u]=c(n,o);else if(ArrayBuffer.isView(n))s[u]=y(n);else{let a=t.indexOf(n);a!==-1?s[u]=i[a]:s[u]=o(n)}}return t.pop(),i.pop(),s}function l(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,l);if(e.constructor!==Object&&(c=f.get(e.constructor)))return c(e,l);let s={};t.push(e),i.push(s);for(let u in e){let n=e[u];if(typeof n!="object"||n===null)s[u]=n;else if(n.constructor!==Object&&(c=f.get(n.constructor)))s[u]=c(n,l);else if(ArrayBuffer.isView(n))s[u]=y(n);else{let a=t.indexOf(n);a!==-1?s[u]=i[a]:s[u]=l(n)}}return t.pop(),i.pop(),s}}});var Z={};L(Z,{traverse:()=>W,version:()=>q});var N=k($(),1);var E=k($(),1);var G=(0,E.default)();function C(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 i=t-1;i--;)if(r[i]===".")return r.slice(i+1,t)}return null}var B="4.1.3";var A=(0,N.default)(),q=B;function W(r,t){let i={now:!1};function f(c,p,o,l){let e=A(c),s,u=b({depth:-1,path:""},o);if(u.depth+=1,Array.isArray(e))for(let n=0,a=e.length;n<a&&!l.now;n++){let d=u.path?"".concat(u.path,".").concat(n):"".concat(n);e[n]!==void 0?(u.parent=A(e),u.parentType="array",u.parentKey=j(d),s=f(p(e[n],void 0,h(b({},u),{path:d}),l),p,h(b({},u),{path:d}),l),Number.isNaN(s)&&n<e.length?(e.splice(n,1),n-=1):e[n]=s):e.splice(n,1)}else if(C(e))for(let n in e){if(l.now&&n!=null)break;let a=u.path?"".concat(u.path,".").concat(n):n;u.depth===0&&n!=null&&(u.topmostKey=n),u.parent=A(e),u.parentType="object",u.parentKey=j(a),s=f(p(n,e[n],h(b({},u),{path:a}),l),p,h(b({},u),{path:a}),l),Number.isNaN(s)?delete e[n]:e[n]=s}return e}return f(r,t,{},i)}return U(Z);})();
10
+ "use strict";var astMonkeyTraverse=(()=>{var $=Object.defineProperty,D=Object.defineProperties,E=Object.getOwnPropertyDescriptor,I=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertyNames,k=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var w=(e,t,r)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))S.call(t,r)&&w(e,r,t[r]);if(k)for(var r of k(t))R.call(t,r)&&w(e,r,t[r]);return e},y=(e,t)=>D(e,I(t));var T=(e,t)=>{for(var r in t)$(e,r,{get:t[r],enumerable:!0})},M=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of W(t))!S.call(e,o)&&o!==r&&$(e,o,{get:()=>t[o],enumerable:!(u=E(t,o))||u.enumerable});return e};var N=e=>M($({},"__esModule",{value:!0}),e);var b=(e,t,r)=>w(e,typeof t!="symbol"?t+"":t,r);var F={};T(F,{traverse:()=>P,version:()=>U});var J=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 B=class{constructor(){b(this,"hasRepeatedReferences",!1);b(this,"clones",[]);b(this,"index");b(this,"sources",[])}get(e){if(this.index){let r=this.index.get(e);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function j(e,t){let r=t.get(e);if(r!==void 0)return r;let u=e.slice(0);return t.set(e,u),u}function V(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let n=Buffer.from(e);return t.set(e,n),n}let r=j(e.buffer,t);if(e instanceof DataView){let n=new DataView(r,e.byteOffset,e.byteLength);return t.set(e,n),n}let u=e.constructor,o=new u(r,e.byteOffset,e.length);return t.set(e,o),o}function O(e,t,r,u){for(let o of r){let n=t[o];e[o]=typeof n!="object"||n===null?n:d(n,u)}}function d(e,t){if(typeof e!="object"||e===null)return e;let r=t.get(e);if(r!==void 0)return r;if(Array.isArray(e)){let n=e.length,p=new Array(n);t.set(e,p);let a=e,s=Object.keys(e);if(s.length===n&&(n===0||s[n-1]==="".concat(n-1)))for(let f=0;f<n;f++){let i=a[f];p[f]=typeof i!="object"||i===null?i:d(i,t)}else O(p,a,s,t);return p}let u=Object.getPrototypeOf(e);if(u===Object.prototype||u===null){let n={};return t.set(e,n),O(n,e,Object.keys(e),t),n}if(e instanceof Date){let n=new Date(e.getTime());return t.set(e,n),n}if(ArrayBuffer.isView(e))return V(e,t);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return j(e,t);if(e instanceof Map){let n=new Map;t.set(e,n);for(let[p,a]of e)n.set(d(p,t),d(a,t));return n}if(e instanceof Set){let n=new Set;t.set(e,n);for(let p of e)n.add(d(p,t));return n}let o={};return t.set(e,o),O(o,e,Object.keys(e),t),o}function g(e){return d(e,new B)}function x(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)}var C="4.2.0";var U=C;function P(e,t){if(typeof t!="function")throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ".concat(typeof t,"."));let r={now:!1};function u(o,n,p,a){let s=o,f,i=h({depth:-1,path:""},p);if(i.depth+=1,Array.isArray(s))for(let l=0,v=s.length;l<v&&!a.now;l++){let m=i.path?"".concat(i.path,".").concat(l):"".concat(l);if(s[l]!==void 0){i.parent=g(s),i.parentType="array",i.parentKey=i.path?i.path.slice(i.path.lastIndexOf(".")+1):null;let c=s[l],A=n(c,void 0,y(h({},i),{path:m}),a);f=u(A===c?A:g(A),n,y(h({},i),{path:m}),a),Number.isNaN(f)&&l<s.length?(s.splice(l,1),l-=1):s[l]=f}else s.splice(l,1)}else if(x(s))for(let l in s){if(a.now&&l!=null)break;let v=i.path?"".concat(i.path,".").concat(l):l;i.depth===0&&l!=null&&(i.topmostKey=l),i.parent=g(s),i.parentType="object",i.parentKey=i.path?i.path.slice(i.path.lastIndexOf(".")+1):null;let m=s[l],c=n(l,m,y(h({},i),{path:v}),a);f=u(c===m?c:g(c),n,y(h({},i),{path:v}),a),Number.isNaN(f)?delete s[l]:s[l]=f}return s}return u(g(e),t,{},r)}return N(F);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.7.3
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.3
23
- * @author Roy Revelt
24
- * @license MIT
25
- * {@link https://codsen.com/os/ast-monkey-util/}
26
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-monkey-traverse",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "description": "Utility library to traverse AST",
5
5
  "keywords": [
6
6
  "ast",
@@ -45,49 +45,49 @@
45
45
  },
46
46
  "types": "types/index.d.ts",
47
47
  "scripts": {
48
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
49
- "cjs-off": "exit 0",
50
- "cjs-on": "exit 0",
51
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
48
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
49
+ "coverage": "c8 uvu test",
50
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
52
51
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
53
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
52
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
54
53
  "examples": "node '../../ops/scripts/run-examples.js'",
55
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
56
- "letspublish": "npm publish --provenance || :",
57
- "lint": "eslint . --fix --concurrency=auto --cache",
54
+ "lect": "node '../../ops/lect/lect.js'",
55
+ "lect:check": "node '../../ops/lect/lect.js' --check",
56
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
57
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
58
58
  "perf": "node perf/check.js",
59
59
  "prep": "echo 'ready'",
60
- "prettier": "prettier",
61
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
62
- "pretest": "npm run lect && npm run build",
60
+ "prettier": "biome format",
61
+ "prettier:format": "biome format --write .",
62
+ "pretest": "npm run lect:check && npm run build",
63
63
  "test": "npm run devtest",
64
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
64
65
  "unit": "uvu test"
65
66
  },
66
- "engines": {
67
- "node": ">=14.18.0"
68
- },
69
67
  "c8": {
68
+ "all": true,
69
+ "branches": 100,
70
70
  "check-coverage": true,
71
- "exclude": [
72
- "**/test/**/*.*"
73
- ],
74
- "lines": 100
71
+ "exclude": ["**/test/**/*.*"],
72
+ "functions": 100,
73
+ "include": ["dist/*.esm.js"],
74
+ "lines": 100,
75
+ "statements": 100
75
76
  },
76
77
  "lect": {
77
78
  "licence": {
78
- "extras": [
79
- ""
80
- ]
79
+ "extras": [""]
81
80
  }
82
81
  },
83
82
  "dependencies": {
84
- "ast-monkey-util": "^3.1.3",
85
- "codsen-utils": "^1.7.3",
86
- "rfdc": "^1.4.1"
83
+ "codsen-utils": "^1.8.0"
87
84
  },
88
85
  "devDependencies": {
89
86
  "deep-equal": "^2.2.3"
90
87
  },
88
+ "engines": {
89
+ "node": ">=18.20.8"
90
+ },
91
91
  "publishConfig": {
92
92
  "registry": "https://registry.npmjs.org/"
93
93
  }
package/types/index.d.ts CHANGED
@@ -5,12 +5,12 @@ interface Stop {
5
5
  interface InnerObj {
6
6
  depth: number;
7
7
  path: string;
8
- topmostKey: string;
8
+ topmostKey?: string;
9
9
  parent: any;
10
10
  parentType: string;
11
11
  parentKey: string | null;
12
12
  }
13
- type Callback = (key: string, val: any, innerObj: InnerObj, stop: Stop) => any;
13
+ type Callback = (key: any, val: any, innerObj: InnerObj, stop: Stop) => any;
14
14
  /**
15
15
  * Utility library to traverse AST
16
16
  */