ast-monkey-traverse-with-lookahead 4.0.13 → 4.0.14

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2023 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2024 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
@@ -274,6 +274,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
274
274
 
275
275
  MIT License.
276
276
 
277
- Copyright © 2010-2023 Roy Revelt and other contributors.
277
+ Copyright © 2010-2024 Roy Revelt and other contributors.
278
278
 
279
279
  <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-with-lookahead
3
3
  * @fileoverview Utility library to traverse AST, reports upcoming values
4
- * @version 4.0.13
4
+ * @version 4.0.14
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-monkey-traverse-with-lookahead/}
8
8
  */
9
9
 
10
- import f from"rfdc";import{isPlainObject as E}from"codsen-utils";var c="4.0.13";var u=f(),S=c;function x(h,d,$=0){function l(e){return typeof e=="string"&&e[0]==="."?e.slice(1):e}let g={now:!1},s=[];function a(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 p=`${t.path}.${n}`;t.parent=u(e),t.parentType="array",o(e[n],void 0,{...t,path:l(p)},r),a(e[n],o,{...t,path:l(p)},r)}else if(E(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),a(e[n],o,{...t,path:l(i)},r)}return e}function m(){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]]));d(...e)}function y(...e){s.push([...e]),s.length>$&&m()}if(a(h,y,{depth:-1,path:""},g),s.length)for(let e=0,o=s.length;e<o;e++)m()}export{x as traverse,S as version};
10
+ import f from"rfdc";import{isPlainObject as E}from"codsen-utils";var c="4.0.14";var u=f(),S=c;function x(h,d,$=0){function l(e){return typeof e=="string"&&e[0]==="."?e.slice(1):e}let g={now:!1},s=[];function a(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 p=`${t.path}.${n}`;t.parent=u(e),t.parentType="array",o(e[n],void 0,{...t,path:l(p)},r),a(e[n],o,{...t,path:l(p)},r)}else if(E(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),a(e[n],o,{...t,path:l(i)},r)}return e}function m(){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]]));d(...e)}function y(...e){s.push([...e]),s.length>$&&m()}if(a(h,y,{depth:-1,path:""},g),s.length)for(let e=0,o=s.length;e<o;e++)m()}export{x as traverse,S 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.0.13
4
+ * @version 4.0.14
5
5
  * @author Roy Revelt, Codsen Ltd
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 B=Object.create;var h=Object.defineProperty,M=Object.defineProperties,F=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertyNames,v=Object.getOwnPropertySymbols,L=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var D=(s,r,i)=>r in s?h(s,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[r]=i,y=(s,r)=>{for(var i in r||(r={}))S.call(r,i)&&D(s,i,r[i]);if(v)for(var i of v(r))R.call(r,i)&&D(s,i,r[i]);return s},b=(s,r)=>M(s,T(r));var J=(s,r)=>()=>(r||s((r={exports:{}}).exports,r),r.exports),P=(s,r)=>{for(var i in r)h(s,i,{get:r[i],enumerable:!0})},E=(s,r,i,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of I(r))!S.call(s,a)&&a!==i&&h(s,a,{get:()=>r[a],enumerable:!(f=F(r,a))||f.enumerable});return s};var x=(s,r,i)=>(i=s!=null?B(L(s)):{},E(r||!s||!s.__esModule?h(i,"default",{value:s,enumerable:!0}):i,s)),k=s=>E(h({},"__esModule",{value:!0}),s);var d=J((Z,V)=>{"use strict";V.exports=U;function $(s){return s instanceof Buffer?Buffer.from(s):new s.constructor(s.buffer.slice(),s.byteOffset,s.length)}function U(s){if(s=s||{},s.circles)return H(s);return s.proto?f:i;function r(a,o){for(var t=Object.keys(a),n=new Array(t.length),u=0;u<t.length;u++){var e=t[u],l=a[e];typeof l!="object"||l===null?n[e]=l:l instanceof Date?n[e]=new Date(l):ArrayBuffer.isView(l)?n[e]=$(l):n[e]=o(l)}return n}function i(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return r(a,i);if(a instanceof Map)return new Map(r(Array.from(a),i));if(a instanceof Set)return new Set(r(Array.from(a),i));var o={};for(var t in a)if(Object.hasOwnProperty.call(a,t)!==!1){var n=a[t];typeof n!="object"||n===null?o[t]=n:n instanceof Date?o[t]=new Date(n):n instanceof Map?o[t]=new Map(r(Array.from(n),i)):n instanceof Set?o[t]=new Set(r(Array.from(n),i)):ArrayBuffer.isView(n)?o[t]=$(n):o[t]=i(n)}return o}function f(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return r(a,f);if(a instanceof Map)return new Map(r(Array.from(a),f));if(a instanceof Set)return new Set(r(Array.from(a),f));var o={};for(var t in a){var n=a[t];typeof n!="object"||n===null?o[t]=n:n instanceof Date?o[t]=new Date(n):n instanceof Map?o[t]=new Map(r(Array.from(n),f)):n instanceof Set?o[t]=new Set(r(Array.from(n),f)):ArrayBuffer.isView(n)?o[t]=$(n):o[t]=f(n)}return o}}function H(s){var r=[],i=[];return s.proto?o:a;function f(t,n){for(var u=Object.keys(t),e=new Array(u.length),l=0;l<u.length;l++){var p=u[l],m=t[p];if(typeof m!="object"||m===null)e[p]=m;else if(m instanceof Date)e[p]=new Date(m);else if(ArrayBuffer.isView(m))e[p]=$(m);else{var c=r.indexOf(m);c!==-1?e[p]=i[c]:e[p]=n(m)}}return e}function a(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return f(t,a);if(t instanceof Map)return new Map(f(Array.from(t),a));if(t instanceof Set)return new Set(f(Array.from(t),a));var n={};r.push(t),i.push(n);for(var u in t)if(Object.hasOwnProperty.call(t,u)!==!1){var e=t[u];if(typeof e!="object"||e===null)n[u]=e;else if(e instanceof Date)n[u]=new Date(e);else if(e instanceof Map)n[u]=new Map(f(Array.from(e),a));else if(e instanceof Set)n[u]=new Set(f(Array.from(e),a));else if(ArrayBuffer.isView(e))n[u]=$(e);else{var l=r.indexOf(e);l!==-1?n[u]=i[l]:n[u]=a(e)}}return r.pop(),i.pop(),n}function o(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return f(t,o);if(t instanceof Map)return new Map(f(Array.from(t),o));if(t instanceof Set)return new Set(f(Array.from(t),o));var n={};r.push(t),i.push(n);for(var u in t){var e=t[u];if(typeof e!="object"||e===null)n[u]=e;else if(e instanceof Date)n[u]=new Date(e);else if(e instanceof Map)n[u]=new Map(f(Array.from(e),o));else if(e instanceof Set)n[u]=new Set(f(Array.from(e),o));else if(ArrayBuffer.isView(e))n[u]=$(e);else{var l=r.indexOf(e);l!==-1?n[u]=i[l]:n[u]=o(e)}}return r.pop(),i.pop(),n}}});var W={};P(W,{traverse:()=>Q,version:()=>K});var j=x(d(),1);var N=x(d(),1);var _=(0,N.default)();function O(s){if(s==null||typeof s!="object")return!1;let r=Object.getPrototypeOf(s);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in s)&&!(Symbol.toStringTag in s)}var C="4.0.13";var A=(0,j.default)(),K=C;function Q(s,r,i=0){function f(e){return typeof e=="string"&&e[0]==="."?e.slice(1):e}let a={now:!1},o=[];function t(e,l,p,m){if(p=y({},p),p.depth+=1,Array.isArray(e))for(let c=0,g=e.length;c<g&&!m.now;c++){let w=`${p.path}.${c}`;p.parent=A(e),p.parentType="array",l(e[c],void 0,b(y({},p),{path:f(w)}),m),t(e[c],l,b(y({},p),{path:f(w)}),m)}else if(O(e))for(let c in e){if(m.now&&c!=null)break;let g=`${p.path}.${c}`;p.depth===0&&c!=null&&(p.topmostKey=c),p.parent=A(e),p.parentType="object",l(c,e[c],b(y({},p),{path:f(g)}),m),t(e[c],l,b(y({},p),{path:f(g)}),m)}return e}function n(){let e=o.shift();e[2].next=[];for(let l=0;l<i&&o[l];l++)e[2].next.push(A([o[l][0],o[l][1],o[l][2]]));r(...e)}function u(...e){o.push([...e]),o.length>i&&n()}if(t(s,u,{depth:-1,path:""},a),o.length)for(let e=0,l=o.length;e<l;e++)n()}return k(W);})();
10
+ "use strict";var astMonkeyTraverseWithLookahead=(()=>{var B=Object.create;var h=Object.defineProperty,M=Object.defineProperties,F=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertyNames,v=Object.getOwnPropertySymbols,L=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var D=(s,r,i)=>r in s?h(s,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[r]=i,y=(s,r)=>{for(var i in r||(r={}))S.call(r,i)&&D(s,i,r[i]);if(v)for(var i of v(r))R.call(r,i)&&D(s,i,r[i]);return s},b=(s,r)=>M(s,T(r));var J=(s,r)=>()=>(r||s((r={exports:{}}).exports,r),r.exports),P=(s,r)=>{for(var i in r)h(s,i,{get:r[i],enumerable:!0})},E=(s,r,i,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of I(r))!S.call(s,a)&&a!==i&&h(s,a,{get:()=>r[a],enumerable:!(f=F(r,a))||f.enumerable});return s};var x=(s,r,i)=>(i=s!=null?B(L(s)):{},E(r||!s||!s.__esModule?h(i,"default",{value:s,enumerable:!0}):i,s)),k=s=>E(h({},"__esModule",{value:!0}),s);var d=J((Z,V)=>{"use strict";V.exports=U;function $(s){return s instanceof Buffer?Buffer.from(s):new s.constructor(s.buffer.slice(),s.byteOffset,s.length)}function U(s){if(s=s||{},s.circles)return H(s);return s.proto?f:i;function r(a,o){for(var t=Object.keys(a),n=new Array(t.length),u=0;u<t.length;u++){var e=t[u],l=a[e];typeof l!="object"||l===null?n[e]=l:l instanceof Date?n[e]=new Date(l):ArrayBuffer.isView(l)?n[e]=$(l):n[e]=o(l)}return n}function i(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return r(a,i);if(a instanceof Map)return new Map(r(Array.from(a),i));if(a instanceof Set)return new Set(r(Array.from(a),i));var o={};for(var t in a)if(Object.hasOwnProperty.call(a,t)!==!1){var n=a[t];typeof n!="object"||n===null?o[t]=n:n instanceof Date?o[t]=new Date(n):n instanceof Map?o[t]=new Map(r(Array.from(n),i)):n instanceof Set?o[t]=new Set(r(Array.from(n),i)):ArrayBuffer.isView(n)?o[t]=$(n):o[t]=i(n)}return o}function f(a){if(typeof a!="object"||a===null)return a;if(a instanceof Date)return new Date(a);if(Array.isArray(a))return r(a,f);if(a instanceof Map)return new Map(r(Array.from(a),f));if(a instanceof Set)return new Set(r(Array.from(a),f));var o={};for(var t in a){var n=a[t];typeof n!="object"||n===null?o[t]=n:n instanceof Date?o[t]=new Date(n):n instanceof Map?o[t]=new Map(r(Array.from(n),f)):n instanceof Set?o[t]=new Set(r(Array.from(n),f)):ArrayBuffer.isView(n)?o[t]=$(n):o[t]=f(n)}return o}}function H(s){var r=[],i=[];return s.proto?o:a;function f(t,n){for(var u=Object.keys(t),e=new Array(u.length),l=0;l<u.length;l++){var p=u[l],m=t[p];if(typeof m!="object"||m===null)e[p]=m;else if(m instanceof Date)e[p]=new Date(m);else if(ArrayBuffer.isView(m))e[p]=$(m);else{var c=r.indexOf(m);c!==-1?e[p]=i[c]:e[p]=n(m)}}return e}function a(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return f(t,a);if(t instanceof Map)return new Map(f(Array.from(t),a));if(t instanceof Set)return new Set(f(Array.from(t),a));var n={};r.push(t),i.push(n);for(var u in t)if(Object.hasOwnProperty.call(t,u)!==!1){var e=t[u];if(typeof e!="object"||e===null)n[u]=e;else if(e instanceof Date)n[u]=new Date(e);else if(e instanceof Map)n[u]=new Map(f(Array.from(e),a));else if(e instanceof Set)n[u]=new Set(f(Array.from(e),a));else if(ArrayBuffer.isView(e))n[u]=$(e);else{var l=r.indexOf(e);l!==-1?n[u]=i[l]:n[u]=a(e)}}return r.pop(),i.pop(),n}function o(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return f(t,o);if(t instanceof Map)return new Map(f(Array.from(t),o));if(t instanceof Set)return new Set(f(Array.from(t),o));var n={};r.push(t),i.push(n);for(var u in t){var e=t[u];if(typeof e!="object"||e===null)n[u]=e;else if(e instanceof Date)n[u]=new Date(e);else if(e instanceof Map)n[u]=new Map(f(Array.from(e),o));else if(e instanceof Set)n[u]=new Set(f(Array.from(e),o));else if(ArrayBuffer.isView(e))n[u]=$(e);else{var l=r.indexOf(e);l!==-1?n[u]=i[l]:n[u]=o(e)}}return r.pop(),i.pop(),n}}});var W={};P(W,{traverse:()=>Q,version:()=>K});var j=x(d(),1);var N=x(d(),1);var _=(0,N.default)();function O(s){if(s==null||typeof s!="object")return!1;let r=Object.getPrototypeOf(s);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in s)&&!(Symbol.toStringTag in s)}var C="4.0.14";var A=(0,j.default)(),K=C;function Q(s,r,i=0){function f(e){return typeof e=="string"&&e[0]==="."?e.slice(1):e}let a={now:!1},o=[];function t(e,l,p,m){if(p=y({},p),p.depth+=1,Array.isArray(e))for(let c=0,g=e.length;c<g&&!m.now;c++){let w=`${p.path}.${c}`;p.parent=A(e),p.parentType="array",l(e[c],void 0,b(y({},p),{path:f(w)}),m),t(e[c],l,b(y({},p),{path:f(w)}),m)}else if(O(e))for(let c in e){if(m.now&&c!=null)break;let g=`${p.path}.${c}`;p.depth===0&&c!=null&&(p.topmostKey=c),p.parent=A(e),p.parentType="object",l(c,e[c],b(y({},p),{path:f(g)}),m),t(e[c],l,b(y({},p),{path:f(g)}),m)}return e}function n(){let e=o.shift();e[2].next=[];for(let l=0;l<i&&o[l];l++)e[2].next.push(A([o[l][0],o[l][1],o[l][2]]));r(...e)}function u(...e){o.push([...e]),o.length>i&&n()}if(t(s,u,{depth:-1,path:""},a),o.length)for(let e=0,l=o.length;e<l;e++)n()}return k(W);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.6.2
14
+ * @version 1.6.3
15
15
  * @author Roy Revelt, Codsen Ltd
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.0.13",
3
+ "version": "4.0.14",
4
4
  "description": "Utility library to traverse AST, reports upcoming values",
5
5
  "keywords": [
6
6
  "ast",
@@ -83,7 +83,7 @@
83
83
  "various": {}
84
84
  },
85
85
  "dependencies": {
86
- "codsen-utils": "^1.6.2",
86
+ "codsen-utils": "^1.6.3",
87
87
  "rfdc": "^1.3.0"
88
88
  }
89
89
  }