ast-monkey-traverse-with-lookahead 4.2.0 → 4.2.2
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,12 +3,18 @@
|
|
|
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.2.2 (2026-08-22)
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
- optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
|
|
11
|
+
|
|
6
12
|
## 4.2.0 (2026-08-19)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
9
15
|
|
|
10
16
|
- rebase to correspond with declared types ([8105a8d](https://github.com/codsen/codsen/commit/8105a8da2ae4372278b3406a6d958fe797846ae3))
|
|
11
|
-
- resolve review findings
|
|
17
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
12
18
|
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
13
19
|
- validate traversal callbacks ([0e08fd4](https://github.com/codsen/codsen/commit/0e08fd4ecd3c25503801dd74218a5c0df8c1dd40))
|
|
14
20
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-monkey-traverse-with-lookahead
|
|
3
3
|
* @fileoverview Utility library to traverse AST, reports upcoming values
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.2
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-monkey-traverse-with-lookahead/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{deepClone as u,isPlainObject as f}from"codsen-utils";var h="4.2.
|
|
10
|
+
import{deepClone as u,isPlainObject as f}from"codsen-utils";var h="4.2.2";var V=h;function D(y,a,$=0){if(typeof a!="function")throw new TypeError(`ast-monkey-traverse-with-lookahead/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ${typeof a}.`);function l(e){return typeof e=="string"&&e[0]==="."?e.slice(1):e}let g={now:!1},s=[];function m(e,o,t,r){if(t={...t},t.depth+=1,Array.isArray(e))for(let n=0,i=e.length;n<i&&!r.now;n++){let c=`${t.path}.${n}`;t.parent=u(e),t.parentType="array",o(e[n],void 0,{...t,path:l(c)},r),m(e[n],o,{...t,path:l(c)},r)}else if(f(e))for(let n in e){if(r.now&&n!=null)break;let i=`${t.path}.${n}`;t.depth===0&&n!=null&&(t.topmostKey=n),t.parent=u(e),t.parentType="object",o(n,e[n],{...t,path:l(i)},r),m(e[n],o,{...t,path:l(i)},r)}}function p(){let e=s.shift();e[2].next=[];for(let o=0;o<$&&s[o];o++)e[2].next.push(u([s[o][0],s[o][1],s[o][2]]));a(...e)}function d(...e){s.push([...e]),s.length>$&&p()}if(m(y,d,{depth:-1,path:""},g),s.length)for(let e=0,o=s.length;e<o;e++)p()}export{D as traverse,V as version};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-monkey-traverse-with-lookahead
|
|
3
3
|
* @fileoverview Utility library to traverse AST, reports upcoming values
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.2
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-monkey-traverse-with-lookahead/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var astMonkeyTraverseWithLookahead=(()=>{var $=Object.defineProperty,
|
|
10
|
+
"use strict";var astMonkeyTraverseWithLookahead=(()=>{var $=Object.defineProperty,j=Object.defineProperties,V=Object.getOwnPropertyDescriptor,I=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var A=(e,t,n)=>t in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h=(e,t)=>{for(var n in t||(t={}))D.call(t,n)&&A(e,n,t[n]);if(S)for(var n of S(t))R.call(t,n)&&A(e,n,t[n]);return e},m=(e,t)=>j(e,I(t));var T=(e,t)=>{for(var n in t)$(e,n,{get:t[n],enumerable:!0})},M=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of N(t))!D.call(e,s)&&s!==n&&$(e,s,{get:()=>t[s],enumerable:!(l=V(t,s))||l.enumerable});return e};var W=e=>M($({},"__esModule",{value:!0}),e);var y=(e,t,n)=>A(e,typeof t!="symbol"?t+"":t,n);var J={};T(J,{traverse:()=>U,version:()=>P});var G=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 F=class{constructor(){y(this,"hasRepeatedReferences",!1);y(this,"clones",[]);y(this,"index");y(this,"sources",[])}get(e){if(this.index){let n=this.index.get(e);return n!==void 0&&(this.hasRepeatedReferences=!0),n}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 n=0;n<this.sources.length;n++)this.index.set(this.sources[n],this.clones[n]);this.sources=[],this.clones=[]}}};function C(e,t){let n=t.get(e);if(n!==void 0)return n;let l=e.slice(0);return t.set(e,l),l}function B(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let r=Buffer.from(e);return t.set(e,r),r}let n=C(e.buffer,t);if(e instanceof DataView){let r=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,r),r}let l=e.constructor,s=new l(n,e.byteOffset,e.length);return t.set(e,s),s}function k(e,t,n,l){for(let s of n){let r=t[s];e[s]=typeof r!="object"||r===null?r:d(r,l)}}function d(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let r=e.length,f=new Array(r);t.set(e,f);let c=e,g=Object.keys(e);if(g.length===r&&(r===0||g[r-1]==="".concat(r-1)))for(let o=0;o<r;o++){let i=c[o];f[o]=typeof i!="object"||i===null?i:d(i,t)}else k(f,c,g,t);return f}let l=Object.getPrototypeOf(e);if(l===Object.prototype||l===null){let r={};return t.set(e,r),k(r,e,Object.keys(e),t),r}if(e instanceof Date){let r=new Date(e.getTime());return t.set(e,r),r}if(ArrayBuffer.isView(e))return B(e,t);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return C(e,t);if(e instanceof Map){let r=new Map;t.set(e,r);for(let[f,c]of e)r.set(d(f,t),d(c,t));return r}if(e instanceof Set){let r=new Set;t.set(e,r);for(let f of e)r.add(d(f,t));return r}let s={};return t.set(e,s),k(s,e,Object.keys(e),t),s}function v(e){return d(e,new F)}function E(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 x,K=(x=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:x.get;var _=Date.prototype.getTime;var O="4.2.2";var P=O;function U(e,t,n=0){if(typeof t!="function")throw new TypeError("ast-monkey-traverse-with-lookahead/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ".concat(typeof t,"."));function l(o){return typeof o=="string"&&o[0]==="."?o.slice(1):o}let s={now:!1},r=[];function f(o,i,u,p){if(u=h({},u),u.depth+=1,Array.isArray(o))for(let a=0,b=o.length;a<b&&!p.now;a++){let w="".concat(u.path,".").concat(a);u.parent=v(o),u.parentType="array",i(o[a],void 0,m(h({},u),{path:l(w)}),p),f(o[a],i,m(h({},u),{path:l(w)}),p)}else if(E(o))for(let a in o){if(p.now&&a!=null)break;let b="".concat(u.path,".").concat(a);u.depth===0&&a!=null&&(u.topmostKey=a),u.parent=v(o),u.parentType="object",i(a,o[a],m(h({},u),{path:l(b)}),p),f(o[a],i,m(h({},u),{path:l(b)}),p)}}function c(){let o=r.shift();o[2].next=[];for(let i=0;i<n&&r[i];i++)o[2].next.push(v([r[i][0],r[i][1],r[i][2]]));t(...o)}function g(...o){r.push([...o]),r.length>n&&c()}if(f(e,g,{depth:-1,path:""},s),r.length)for(let o=0,i=r.length;o<i;o++)c()}return W(J);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.9.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-monkey-traverse-with-lookahead",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "Utility library to traverse AST, reports upcoming values",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"various": {}
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"codsen-utils": "^1.
|
|
82
|
+
"codsen-utils": "^1.9.0"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">=18.20.8"
|