ast-monkey-traverse
Advanced tools
Comparing version 4.0.12 to 4.0.13
/** | ||
* @name ast-monkey-traverse | ||
* @fileoverview Utility library to traverse AST | ||
* @version 4.0.12 | ||
* @version 4.0.13 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,2 +10,2 @@ * @license MIT | ||
import g from"rfdc";import{isPlainObject as h}from"codsen-utils";import{parent as m}from"ast-monkey-util";var u="4.0.12";var a=g(),D=u;function k(c,$){let d={now:!1};function i(b,l,y,r){let n=a(b),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,$,{},d)}export{k as traverse,D as version}; | ||
import g from"rfdc";import{isPlainObject as h}from"codsen-utils";import{parent as m}from"ast-monkey-util";var u="4.0.13";var a=g(),D=u;function k(c,$){let d={now:!1};function i(b,l,y,r){let n=a(b),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,$,{},d)}export{k as traverse,D as version}; |
/** | ||
* @name ast-monkey-traverse | ||
* @fileoverview Utility library to traverse AST | ||
* @version 4.0.12 | ||
* @version 4.0.13 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,7 +10,7 @@ * @license MIT | ||
"use strict";var astMonkeyTraverse=(()=>{var N=Object.create;var b=Object.defineProperty,M=Object.defineProperties,I=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyDescriptors,V=Object.getOwnPropertyNames,A=Object.getOwnPropertySymbols,P=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var w=(r,n,l)=>n in r?b(r,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[n]=l,y=(r,n)=>{for(var l in n||(n={}))S.call(n,l)&&w(r,l,n[l]);if(A)for(var l of A(n))R.call(n,l)&&w(r,l,n[l]);return r},h=(r,n)=>M(r,T(n));var K=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports),F=(r,n)=>{for(var l in n)b(r,l,{get:n[l],enumerable:!0})},D=(r,n,l,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of V(n))!S.call(r,s)&&s!==l&&b(r,s,{get:()=>n[s],enumerable:!(p=I(n,s))||p.enumerable});return r};var j=(r,n,l)=>(l=r!=null?N(P(r)):{},D(n||!r||!r.__esModule?b(l,"default",{value:r,enumerable:!0}):l,r)),L=r=>D(b({},"__esModule",{value:!0}),r);var $=K((z,O)=>{"use strict";O.exports=U;function d(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function U(r){if(r=r||{},r.circles)return J(r);return r.proto?p:l;function n(s,f){for(var t=Object.keys(s),e=new Array(t.length),a=0;a<t.length;a++){var i=t[a],o=s[i];typeof o!="object"||o===null?e[i]=o:o instanceof Date?e[i]=new Date(o):ArrayBuffer.isView(o)?e[i]=d(o):e[i]=f(o)}return e}function l(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return n(s,l);if(s instanceof Map)return new Map(n(Array.from(s),l));if(s instanceof Set)return new Set(n(Array.from(s),l));var f={};for(var t in s)if(Object.hasOwnProperty.call(s,t)!==!1){var e=s[t];typeof e!="object"||e===null?f[t]=e:e instanceof Date?f[t]=new Date(e):e instanceof Map?f[t]=new Map(n(Array.from(e),l)):e instanceof Set?f[t]=new Set(n(Array.from(e),l)):ArrayBuffer.isView(e)?f[t]=d(e):f[t]=l(e)}return f}function p(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return n(s,p);if(s instanceof Map)return new Map(n(Array.from(s),p));if(s instanceof Set)return new Set(n(Array.from(s),p));var f={};for(var t in s){var e=s[t];typeof e!="object"||e===null?f[t]=e:e instanceof Date?f[t]=new Date(e):e instanceof Map?f[t]=new Map(n(Array.from(e),p)):e instanceof Set?f[t]=new Set(n(Array.from(e),p)):ArrayBuffer.isView(e)?f[t]=d(e):f[t]=p(e)}return f}}function J(r){var n=[],l=[];return r.proto?f:s;function p(t,e){for(var a=Object.keys(t),i=new Array(a.length),o=0;o<a.length;o++){var u=a[o],c=t[u];if(typeof c!="object"||c===null)i[u]=c;else if(c instanceof Date)i[u]=new Date(c);else if(ArrayBuffer.isView(c))i[u]=d(c);else{var m=n.indexOf(c);m!==-1?i[u]=l[m]:i[u]=e(c)}}return i}function s(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return p(t,s);if(t instanceof Map)return new Map(p(Array.from(t),s));if(t instanceof Set)return new Set(p(Array.from(t),s));var e={};n.push(t),l.push(e);for(var a in t)if(Object.hasOwnProperty.call(t,a)!==!1){var i=t[a];if(typeof i!="object"||i===null)e[a]=i;else if(i instanceof Date)e[a]=new Date(i);else if(i instanceof Map)e[a]=new Map(p(Array.from(i),s));else if(i instanceof Set)e[a]=new Set(p(Array.from(i),s));else if(ArrayBuffer.isView(i))e[a]=d(i);else{var o=n.indexOf(i);o!==-1?e[a]=l[o]:e[a]=s(i)}}return n.pop(),l.pop(),e}function f(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return p(t,f);if(t instanceof Map)return new Map(p(Array.from(t),f));if(t instanceof Set)return new Set(p(Array.from(t),f));var e={};n.push(t),l.push(e);for(var a in t){var i=t[a];if(typeof i!="object"||i===null)e[a]=i;else if(i instanceof Date)e[a]=new Date(i);else if(i instanceof Map)e[a]=new Map(p(Array.from(i),f));else if(i instanceof Set)e[a]=new Set(p(Array.from(i),f));else if(ArrayBuffer.isView(i))e[a]=d(i);else{var o=n.indexOf(i);o!==-1?e[a]=l[o]:e[a]=f(i)}}return n.pop(),l.pop(),e}}});var Z={};F(Z,{traverse:()=>H,version:()=>W});var B=j($(),1);var x=j($(),1);var G=(0,x.default)();function E(r){if(r==null||typeof r!="object")return!1;let n=Object.getPrototypeOf(r);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}function Q(r){if(r.includes(".")){let n=r.lastIndexOf(".");if(!r.slice(0,n).includes("."))return r.slice(0,n);for(let l=n-1;l--;)if(r[l]===".")return r.slice(l+1,n)}return null}var g=Q;var C="4.0.12";var v=(0,B.default)(),W=C;function H(r,n){let l={now:!1};function p(s,f,t,e){let a=v(s),i,o=y({depth:-1,path:""},t);if(o.depth+=1,Array.isArray(a))for(let u=0,c=a.length;u<c&&!e.now;u++){let m=o.path?`${o.path}.${u}`:`${u}`;a[u]!==void 0?(o.parent=v(a),o.parentType="array",o.parentKey=g(m),i=p(f(a[u],void 0,h(y({},o),{path:m}),e),f,h(y({},o),{path:m}),e),Number.isNaN(i)&&u<a.length?(a.splice(u,1),u-=1):a[u]=i):a.splice(u,1)}else if(E(a))for(let u in a){if(e.now&&u!=null)break;let c=o.path?`${o.path}.${u}`:u;o.depth===0&&u!=null&&(o.topmostKey=u),o.parent=v(a),o.parentType="object",o.parentKey=g(c),i=p(f(u,a[u],h(y({},o),{path:c}),e),f,h(y({},o),{path:c}),e),Number.isNaN(i)?delete a[u]:a[u]=i}return a}return p(r,n,{},l)}return L(Z);})(); | ||
"use strict";var astMonkeyTraverse=(()=>{var N=Object.create;var b=Object.defineProperty,M=Object.defineProperties,I=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyDescriptors,V=Object.getOwnPropertyNames,A=Object.getOwnPropertySymbols,P=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var w=(r,n,l)=>n in r?b(r,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[n]=l,y=(r,n)=>{for(var l in n||(n={}))S.call(n,l)&&w(r,l,n[l]);if(A)for(var l of A(n))R.call(n,l)&&w(r,l,n[l]);return r},h=(r,n)=>M(r,T(n));var K=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports),F=(r,n)=>{for(var l in n)b(r,l,{get:n[l],enumerable:!0})},D=(r,n,l,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of V(n))!S.call(r,s)&&s!==l&&b(r,s,{get:()=>n[s],enumerable:!(p=I(n,s))||p.enumerable});return r};var j=(r,n,l)=>(l=r!=null?N(P(r)):{},D(n||!r||!r.__esModule?b(l,"default",{value:r,enumerable:!0}):l,r)),L=r=>D(b({},"__esModule",{value:!0}),r);var $=K((z,O)=>{"use strict";O.exports=U;function d(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function U(r){if(r=r||{},r.circles)return J(r);return r.proto?p:l;function n(s,f){for(var t=Object.keys(s),e=new Array(t.length),a=0;a<t.length;a++){var i=t[a],o=s[i];typeof o!="object"||o===null?e[i]=o:o instanceof Date?e[i]=new Date(o):ArrayBuffer.isView(o)?e[i]=d(o):e[i]=f(o)}return e}function l(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return n(s,l);if(s instanceof Map)return new Map(n(Array.from(s),l));if(s instanceof Set)return new Set(n(Array.from(s),l));var f={};for(var t in s)if(Object.hasOwnProperty.call(s,t)!==!1){var e=s[t];typeof e!="object"||e===null?f[t]=e:e instanceof Date?f[t]=new Date(e):e instanceof Map?f[t]=new Map(n(Array.from(e),l)):e instanceof Set?f[t]=new Set(n(Array.from(e),l)):ArrayBuffer.isView(e)?f[t]=d(e):f[t]=l(e)}return f}function p(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return n(s,p);if(s instanceof Map)return new Map(n(Array.from(s),p));if(s instanceof Set)return new Set(n(Array.from(s),p));var f={};for(var t in s){var e=s[t];typeof e!="object"||e===null?f[t]=e:e instanceof Date?f[t]=new Date(e):e instanceof Map?f[t]=new Map(n(Array.from(e),p)):e instanceof Set?f[t]=new Set(n(Array.from(e),p)):ArrayBuffer.isView(e)?f[t]=d(e):f[t]=p(e)}return f}}function J(r){var n=[],l=[];return r.proto?f:s;function p(t,e){for(var a=Object.keys(t),i=new Array(a.length),o=0;o<a.length;o++){var u=a[o],c=t[u];if(typeof c!="object"||c===null)i[u]=c;else if(c instanceof Date)i[u]=new Date(c);else if(ArrayBuffer.isView(c))i[u]=d(c);else{var m=n.indexOf(c);m!==-1?i[u]=l[m]:i[u]=e(c)}}return i}function s(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return p(t,s);if(t instanceof Map)return new Map(p(Array.from(t),s));if(t instanceof Set)return new Set(p(Array.from(t),s));var e={};n.push(t),l.push(e);for(var a in t)if(Object.hasOwnProperty.call(t,a)!==!1){var i=t[a];if(typeof i!="object"||i===null)e[a]=i;else if(i instanceof Date)e[a]=new Date(i);else if(i instanceof Map)e[a]=new Map(p(Array.from(i),s));else if(i instanceof Set)e[a]=new Set(p(Array.from(i),s));else if(ArrayBuffer.isView(i))e[a]=d(i);else{var o=n.indexOf(i);o!==-1?e[a]=l[o]:e[a]=s(i)}}return n.pop(),l.pop(),e}function f(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return p(t,f);if(t instanceof Map)return new Map(p(Array.from(t),f));if(t instanceof Set)return new Set(p(Array.from(t),f));var e={};n.push(t),l.push(e);for(var a in t){var i=t[a];if(typeof i!="object"||i===null)e[a]=i;else if(i instanceof Date)e[a]=new Date(i);else if(i instanceof Map)e[a]=new Map(p(Array.from(i),f));else if(i instanceof Set)e[a]=new Set(p(Array.from(i),f));else if(ArrayBuffer.isView(i))e[a]=d(i);else{var o=n.indexOf(i);o!==-1?e[a]=l[o]:e[a]=f(i)}}return n.pop(),l.pop(),e}}});var Z={};F(Z,{traverse:()=>H,version:()=>W});var B=j($(),1);var x=j($(),1);var G=(0,x.default)();function E(r){if(r==null||typeof r!="object")return!1;let n=Object.getPrototypeOf(r);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}function Q(r){if(r.includes(".")){let n=r.lastIndexOf(".");if(!r.slice(0,n).includes("."))return r.slice(0,n);for(let l=n-1;l--;)if(r[l]===".")return r.slice(l+1,n)}return null}var g=Q;var C="4.0.13";var v=(0,B.default)(),W=C;function H(r,n){let l={now:!1};function p(s,f,t,e){let a=v(s),i,o=y({depth:-1,path:""},t);if(o.depth+=1,Array.isArray(a))for(let u=0,c=a.length;u<c&&!e.now;u++){let m=o.path?`${o.path}.${u}`:`${u}`;a[u]!==void 0?(o.parent=v(a),o.parentType="array",o.parentKey=g(m),i=p(f(a[u],void 0,h(y({},o),{path:m}),e),f,h(y({},o),{path:m}),e),Number.isNaN(i)&&u<a.length?(a.splice(u,1),u-=1):a[u]=i):a.splice(u,1)}else if(E(a))for(let u in a){if(e.now&&u!=null)break;let c=o.path?`${o.path}.${u}`:u;o.depth===0&&u!=null&&(o.topmostKey=u),o.parent=v(a),o.parentType="object",o.parentKey=g(c),i=p(f(u,a[u],h(y({},o),{path:c}),e),f,h(y({},o),{path:c}),e),Number.isNaN(i)?delete a[u]:a[u]=i}return a}return p(r,n,{},l)}return L(Z);})(); | ||
/** | ||
* @name codsen-utils | ||
* @fileoverview Various utility functions | ||
* @version 1.6.1 | ||
* @version 1.6.2 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -17,0 +17,0 @@ * @license MIT |
{ | ||
"name": "ast-monkey-traverse", | ||
"version": "4.0.12", | ||
"version": "4.0.13", | ||
"description": "Utility library to traverse AST", | ||
@@ -85,3 +85,3 @@ "keywords": [ | ||
"ast-monkey-util": "^3.0.7", | ||
"codsen-utils": "^1.6.1", | ||
"codsen-utils": "^1.6.2", | ||
"rfdc": "^1.3.0" | ||
@@ -88,0 +88,0 @@ }, |
@@ -19,2 +19,2 @@ declare const version: string; | ||
export { Callback, InnerObj, Stop, traverse, version }; | ||
export { type Callback, type InnerObj, type Stop, traverse, version }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16932
Updatedcodsen-utils@^1.6.2