ast-monkey-traverse 4.0.29 → 4.0.30
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-monkey-traverse
|
|
3
3
|
* @fileoverview Utility library to traverse AST
|
|
4
|
-
* @version 4.0.
|
|
4
|
+
* @version 4.0.30
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import f from"rfdc";import{isPlainObject as h}from"codsen-utils";import{parent as m}from"ast-monkey-util";var u="4.0.
|
|
10
|
+
import f from"rfdc";import{isPlainObject as h}from"codsen-utils";import{parent as m}from"ast-monkey-util";var u="4.0.30";var a=f(),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(h(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};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-monkey-traverse
|
|
3
3
|
* @fileoverview Utility library to traverse AST
|
|
4
|
-
* @version 4.0.
|
|
4
|
+
* @version 4.0.30
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
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.0.
|
|
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.0.30";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);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.6.
|
|
14
|
+
* @version 1.6.18
|
|
15
15
|
* @author Roy Revelt, Codsen Ltd
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name ast-monkey-util
|
|
21
21
|
* @fileoverview Utility library of AST helper functions
|
|
22
|
-
* @version 3.0.
|
|
22
|
+
* @version 3.0.20
|
|
23
23
|
* @author Roy Revelt, Codsen Ltd
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/ast-monkey-util/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-monkey-traverse",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.30",
|
|
4
4
|
"description": "Utility library to traverse AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"ast-monkey-util": "^3.0.
|
|
85
|
-
"codsen-utils": "^1.6.
|
|
84
|
+
"ast-monkey-util": "^3.0.20",
|
|
85
|
+
"codsen-utils": "^1.6.18",
|
|
86
86
|
"rfdc": "^1.4.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|