Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ast-monkey-traverse

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-monkey-traverse - npm Package Compare versions

Comparing version 3.0.12 to 3.0.13

4

dist/ast-monkey-traverse.esm.js
/**
* @name ast-monkey-traverse
* @fileoverview Utility library to traverse AST
* @version 3.0.12
* @version 3.0.13
* @author Roy Revelt, Codsen Ltd

@@ -10,2 +10,2 @@ * @license MIT

import p from"lodash.clonedeep";import g from"lodash.isplainobject";import{parent as m}from"ast-monkey-util";var u="3.0.12";var D=u;function k(y,c){let d={now:!1};function a($,l,b,r){let n=p($),s,t={depth:-1,path:"",...b};if(t.depth+=1,Array.isArray(n))for(let e=0,o=n.length;e<o&&!r.now;e++){let i=t.path?`${t.path}.${e}`:`${e}`;n[e]!==void 0?(t.parent=p(n),t.parentType="array",t.parentKey=m(i),s=a(l(n[e],void 0,{...t,path:i},r),l,{...t,path:i},r),Number.isNaN(s)&&e<n.length?(n.splice(e,1),e-=1):n[e]=s):n.splice(e,1)}else if(g(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=p(n),t.parentType="object",t.parentKey=m(o),s=a(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 a(y,c,{},d)}export{k as traverse,D as version};
import p from"lodash.clonedeep";import g from"lodash.isplainobject";import{parent as m}from"ast-monkey-util";var u="3.0.13";var D=u;function k(y,c){let d={now:!1};function a($,l,b,r){let n=p($),s,t={depth:-1,path:"",...b};if(t.depth+=1,Array.isArray(n))for(let e=0,o=n.length;e<o&&!r.now;e++){let i=t.path?`${t.path}.${e}`:`${e}`;n[e]!==void 0?(t.parent=p(n),t.parentType="array",t.parentKey=m(i),s=a(l(n[e],void 0,{...t,path:i},r),l,{...t,path:i},r),Number.isNaN(s)&&e<n.length?(n.splice(e,1),e-=1):n[e]=s):n.splice(e,1)}else if(g(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=p(n),t.parentType="object",t.parentKey=m(o),s=a(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 a(y,c,{},d)}export{k as traverse,D as version};
/**
* @name ast-monkey-traverse
* @fileoverview Utility library to traverse AST
* @version 3.0.12
* @version 3.0.13
* @author Roy Revelt, Codsen Ltd

@@ -10,7 +10,7 @@ * @license MIT

var astMonkeyTraverse=(()=>{var ne=Object.create;var w=Object.defineProperty,oe=Object.defineProperties,ae=Object.getOwnPropertyDescriptor,ie=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertyNames,rt=Object.getOwnPropertySymbols,ce=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var ot=(t,e,r)=>e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v=(t,e)=>{for(var r in e||(e={}))nt.call(e,r)&&ot(t,r,e[r]);if(rt)for(var r of rt(e))ue.call(e,r)&&ot(t,r,e[r]);return t},T=(t,e)=>oe(t,ie(e)),at=t=>w(t,"__esModule",{value:!0});var it=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),le=(t,e)=>{for(var r in e)w(t,r,{get:e[r],enumerable:!0})},st=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of se(e))!nt.call(t,o)&&(r||o!=="default")&&w(t,o,{get:()=>e[o],enumerable:!(n=ae(e,o))||n.enumerable});return t},ct=(t,e)=>st(at(w(t!=null?ne(ce(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),fe=(t=>(e,r)=>t&&t.get(e)||(r=st(at({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Xt=it((C,x)=>{var pe=200,ut="__lodash_hash_undefined__",lt=9007199254740991,k="[object Arguments]",de="[object Array]",ft="[object Boolean]",pt="[object Date]",he="[object Error]",F="[object Function]",dt="[object GeneratorFunction]",P="[object Map]",ht="[object Number]",H="[object Object]",gt="[object Promise]",yt="[object RegExp]",D="[object Set]",bt="[object String]",_t="[object Symbol]",L="[object WeakMap]",mt="[object ArrayBuffer]",N="[object DataView]",$t="[object Float32Array]",vt="[object Float64Array]",jt="[object Int8Array]",Ot="[object Int16Array]",St="[object Int32Array]",xt="[object Uint8Array]",wt="[object Uint8ClampedArray]",Tt="[object Uint16Array]",At="[object Uint32Array]",ge=/[\\^$.*+?()[\]{}|]/g,ye=/\w*$/,be=/^\[object .+?Constructor\]$/,_e=/^(?:0|[1-9]\d*)$/,a={};a[k]=a[de]=a[mt]=a[N]=a[ft]=a[pt]=a[$t]=a[vt]=a[jt]=a[Ot]=a[St]=a[P]=a[ht]=a[H]=a[yt]=a[D]=a[bt]=a[_t]=a[xt]=a[wt]=a[Tt]=a[At]=!0;a[he]=a[F]=a[L]=!1;var me=typeof global=="object"&&global&&global.Object===Object&&global,$e=typeof self=="object"&&self&&self.Object===Object&&self,d=me||$e||Function("return this")(),Et=typeof C=="object"&&C&&!C.nodeType&&C,Ct=Et&&typeof x=="object"&&x&&!x.nodeType&&x,ve=Ct&&Ct.exports===Et;function je(t,e){return t.set(e[0],e[1]),t}function Oe(t,e){return t.add(e),t}function Se(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function xe(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function It(t,e,r,n){var o=-1,c=t?t.length:0;for(n&&c&&(r=t[++o]);++o<c;)r=e(r,t[o],o,t);return r}function we(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Te(t,e){return t==null?void 0:t[e]}function Pt(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Dt(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function U(t,e){return function(r){return t(e(r))}}function Nt(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Ae=Array.prototype,Ee=Function.prototype,K=Object.prototype,J=d["__core-js_shared__"],Kt=function(){var t=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Vt=Ee.toString,y=K.hasOwnProperty,V=K.toString,Ce=RegExp("^"+Vt.call(y).replace(ge,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=ve?d.Buffer:void 0,Rt=d.Symbol,Bt=d.Uint8Array,Ie=U(Object.getPrototypeOf,Object),Pe=Object.create,De=K.propertyIsEnumerable,Ne=Ae.splice,Gt=Object.getOwnPropertySymbols,Ke=Mt?Mt.isBuffer:void 0,Ve=U(Object.keys,Object),W=S(d,"DataView"),A=S(d,"Map"),q=S(d,"Promise"),Y=S(d,"Set"),X=S(d,"WeakMap"),E=S(Object,"create"),Me=$(W),Re=$(A),Be=$(q),Ge=$(Y),ke=$(X),kt=Rt?Rt.prototype:void 0,Ft=kt?kt.valueOf:void 0;function _(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Fe(){this.__data__=E?E(null):{}}function He(t){return this.has(t)&&delete this.__data__[t]}function Le(t){var e=this.__data__;if(E){var r=e[t];return r===ut?void 0:r}return y.call(e,t)?e[t]:void 0}function Ue(t){var e=this.__data__;return E?e[t]!==void 0:y.call(e,t)}function Je(t,e){var r=this.__data__;return r[t]=E&&e===void 0?ut:e,this}_.prototype.clear=Fe;_.prototype.delete=He;_.prototype.get=Le;_.prototype.has=Ue;_.prototype.set=Je;function h(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function We(){this.__data__=[]}function qe(t){var e=this.__data__,r=M(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ne.call(e,r,1),!0}function Ye(t){var e=this.__data__,r=M(e,t);return r<0?void 0:e[r][1]}function Xe(t){return M(this.__data__,t)>-1}function Ze(t,e){var r=this.__data__,n=M(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}h.prototype.clear=We;h.prototype.delete=qe;h.prototype.get=Ye;h.prototype.has=Xe;h.prototype.set=Ze;function j(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Qe(){this.__data__={hash:new _,map:new(A||h),string:new _}}function ze(t){return R(this,t).delete(t)}function tr(t){return R(this,t).get(t)}function er(t){return R(this,t).has(t)}function rr(t,e){return R(this,t).set(t,e),this}j.prototype.clear=Qe;j.prototype.delete=ze;j.prototype.get=tr;j.prototype.has=er;j.prototype.set=rr;function O(t){this.__data__=new h(t)}function nr(){this.__data__=new h}function or(t){return this.__data__.delete(t)}function ar(t){return this.__data__.get(t)}function ir(t){return this.__data__.has(t)}function sr(t,e){var r=this.__data__;if(r instanceof h){var n=r.__data__;if(!A||n.length<pe-1)return n.push([t,e]),this;r=this.__data__=new j(n)}return r.set(t,e),this}O.prototype.clear=nr;O.prototype.delete=or;O.prototype.get=ar;O.prototype.has=ir;O.prototype.set=sr;function cr(t,e){var r=z(t)||Pr(t)?we(t.length,String):[],n=r.length,o=!!n;for(var c in t)(e||y.call(t,c))&&!(o&&(c=="length"||Ar(c,n)))&&r.push(c);return r}function Ht(t,e,r){var n=t[e];(!(y.call(t,e)&&Wt(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}function M(t,e){for(var r=t.length;r--;)if(Wt(t[r][0],e))return r;return-1}function ur(t,e){return t&&Lt(e,tt(e),t)}function Z(t,e,r,n,o,c,f){var s;if(n&&(s=c?n(t,o,c,f):n(t)),s!==void 0)return s;if(!B(t))return t;var l=z(t);if(l){if(s=xr(t),!e)return jr(t,s)}else{var p=m(t),u=p==F||p==dt;if(Nr(t))return gr(t,e);if(p==H||p==k||u&&!c){if(Pt(t))return c?t:{};if(s=wr(u?{}:t),!e)return Or(t,ur(s,t))}else{if(!a[p])return c?t:{};s=Tr(t,p,Z,e)}}f||(f=new O);var i=f.get(t);if(i)return i;if(f.set(t,s),!l)var g=r?Sr(t):tt(t);return Se(g||t,function(b,I){g&&(I=b,b=t[I]),Ht(s,I,Z(b,e,r,n,I,t,f))}),s}function lr(t){return B(t)?Pe(t):{}}function fr(t,e,r){var n=e(t);return z(t)?n:xe(n,r(t))}function pr(t){return V.call(t)}function dr(t){if(!B(t)||Cr(t))return!1;var e=Yt(t)||Pt(t)?Ce:be;return e.test($(t))}function hr(t){if(!Jt(t))return Ve(t);var e=[];for(var r in Object(t))y.call(t,r)&&r!="constructor"&&e.push(r);return e}function gr(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function Q(t){var e=new t.constructor(t.byteLength);return new Bt(e).set(new Bt(t)),e}function yr(t,e){var r=e?Q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function br(t,e,r){var n=e?r(Dt(t),!0):Dt(t);return It(n,je,new t.constructor)}function _r(t){var e=new t.constructor(t.source,ye.exec(t));return e.lastIndex=t.lastIndex,e}function mr(t,e,r){var n=e?r(Nt(t),!0):Nt(t);return It(n,Oe,new t.constructor)}function $r(t){return Ft?Object(Ft.call(t)):{}}function vr(t,e){var r=e?Q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function jr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Lt(t,e,r,n){r||(r={});for(var o=-1,c=e.length;++o<c;){var f=e[o],s=n?n(r[f],t[f],f,r,t):void 0;Ht(r,f,s===void 0?t[f]:s)}return r}function Or(t,e){return Lt(t,Ut(t),e)}function Sr(t){return fr(t,tt,Ut)}function R(t,e){var r=t.__data__;return Er(e)?r[typeof e=="string"?"string":"hash"]:r.map}function S(t,e){var r=Te(t,e);return dr(r)?r:void 0}var Ut=Gt?U(Gt,Object):Mr,m=pr;(W&&m(new W(new ArrayBuffer(1)))!=N||A&&m(new A)!=P||q&&m(q.resolve())!=gt||Y&&m(new Y)!=D||X&&m(new X)!=L)&&(m=function(t){var e=V.call(t),r=e==H?t.constructor:void 0,n=r?$(r):void 0;if(n)switch(n){case Me:return N;case Re:return P;case Be:return gt;case Ge:return D;case ke:return L}return e});function xr(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&y.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function wr(t){return typeof t.constructor=="function"&&!Jt(t)?lr(Ie(t)):{}}function Tr(t,e,r,n){var o=t.constructor;switch(e){case mt:return Q(t);case ft:case pt:return new o(+t);case N:return yr(t,n);case $t:case vt:case jt:case Ot:case St:case xt:case wt:case Tt:case At:return vr(t,n);case P:return br(t,n,r);case ht:case bt:return new o(t);case yt:return _r(t);case D:return mr(t,n,r);case _t:return $r(t)}}function Ar(t,e){return e=e==null?lt:e,!!e&&(typeof t=="number"||_e.test(t))&&t>-1&&t%1==0&&t<e}function Er(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Cr(t){return!!Kt&&Kt in t}function Jt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||K;return t===r}function $(t){if(t!=null){try{return Vt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ir(t){return Z(t,!0,!0)}function Wt(t,e){return t===e||t!==t&&e!==e}function Pr(t){return Dr(t)&&y.call(t,"callee")&&(!De.call(t,"callee")||V.call(t)==k)}var z=Array.isArray;function qt(t){return t!=null&&Kr(t.length)&&!Yt(t)}function Dr(t){return Vr(t)&&qt(t)}var Nr=Ke||Rr;function Yt(t){var e=B(t)?V.call(t):"";return e==F||e==dt}function Kr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=lt}function B(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Vr(t){return!!t&&typeof t=="object"}function tt(t){return qt(t)?cr(t):hr(t)}function Mr(){return[]}function Rr(){return!1}x.exports=Ir});var te=it((en,zt)=>{var Br="[object Object]";function Gr(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function kr(t,e){return function(r){return t(e(r))}}var Fr=Function.prototype,Zt=Object.prototype,Qt=Fr.toString,Hr=Zt.hasOwnProperty,Lr=Qt.call(Object),Ur=Zt.toString,Jr=kr(Object.getPrototypeOf,Object);function Wr(t){return!!t&&typeof t=="object"}function qr(t){if(!Wr(t)||Ur.call(t)!=Br||Gr(t))return!1;var e=Jr(t);if(e===null)return!0;var r=Hr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Qt.call(r)==Lr}zt.exports=qr});var zr={};le(zr,{traverse:()=>Qr,version:()=>Zr});var G=ct(Xt(),1),re=ct(te(),1);function Yr(t){if(t.includes(".")){let e=t.lastIndexOf(".");if(!t.slice(0,e).includes("."))return t.slice(0,e);for(let r=e-1;r--;)if(t[r]===".")return t.slice(r+1,e)}return null}var et=Yr;var ee="3.0.12";var Zr=ee;function Qr(t,e){let r={now:!1};function n(o,c,f,s){let l=(0,G.default)(o),p,u=v({depth:-1,path:""},f);if(u.depth+=1,Array.isArray(l))for(let i=0,g=l.length;i<g&&!s.now;i++){let b=u.path?`${u.path}.${i}`:`${i}`;l[i]!==void 0?(u.parent=(0,G.default)(l),u.parentType="array",u.parentKey=et(b),p=n(c(l[i],void 0,T(v({},u),{path:b}),s),c,T(v({},u),{path:b}),s),Number.isNaN(p)&&i<l.length?(l.splice(i,1),i-=1):l[i]=p):l.splice(i,1)}else if((0,re.default)(l))for(let i in l){if(s.now&&i!=null)break;let g=u.path?`${u.path}.${i}`:i;u.depth===0&&i!=null&&(u.topmostKey=i),u.parent=(0,G.default)(l),u.parentType="object",u.parentKey=et(g),p=n(c(i,l[i],T(v({},u),{path:g}),s),c,T(v({},u),{path:g}),s),Number.isNaN(p)?delete l[i]:l[i]=p}return l}return n(t,e,{},r)}return fe(zr);})();
var astMonkeyTraverse=(()=>{var re=Object.create;var w=Object.defineProperty,ne=Object.defineProperties,oe=Object.getOwnPropertyDescriptor,ae=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertyNames,rt=Object.getOwnPropertySymbols,se=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable;var nt=(t,e,r)=>e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v=(t,e)=>{for(var r in e||(e={}))ot.call(e,r)&&nt(t,r,e[r]);if(rt)for(var r of rt(e))ce.call(e,r)&&nt(t,r,e[r]);return t},T=(t,e)=>ne(t,ae(e));var at=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ue=(t,e)=>{for(var r in e)w(t,r,{get:e[r],enumerable:!0})},it=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ie(e))!ot.call(t,o)&&o!==r&&w(t,o,{get:()=>e[o],enumerable:!(n=oe(e,o))||n.enumerable});return t};var st=(t,e,r)=>(r=t!=null?re(se(t)):{},it(e||!t||!t.__esModule?w(r,"default",{value:t,enumerable:!0}):r,t)),le=t=>it(w({},"__esModule",{value:!0}),t);var Yt=at((A,j)=>{var fe=200,mt="__lodash_hash_undefined__",$t=9007199254740991,q="[object Arguments]",pe="[object Array]",vt="[object Boolean]",jt="[object Date]",de="[object Error]",Y="[object Function]",Ot="[object GeneratorFunction]",P="[object Map]",St="[object Number]",X="[object Object]",ct="[object Promise]",xt="[object RegExp]",D="[object Set]",wt="[object String]",Tt="[object Symbol]",F="[object WeakMap]",At="[object ArrayBuffer]",N="[object DataView]",Et="[object Float32Array]",Ct="[object Float64Array]",It="[object Int8Array]",Pt="[object Int16Array]",Dt="[object Int32Array]",Nt="[object Uint8Array]",Kt="[object Uint8ClampedArray]",Vt="[object Uint16Array]",Mt="[object Uint32Array]",he=/[\\^$.*+?()[\]{}|]/g,ge=/\w*$/,ye=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,a={};a[q]=a[pe]=a[At]=a[N]=a[vt]=a[jt]=a[Et]=a[Ct]=a[It]=a[Pt]=a[Dt]=a[P]=a[St]=a[X]=a[xt]=a[D]=a[wt]=a[Tt]=a[Nt]=a[Kt]=a[Vt]=a[Mt]=!0;a[de]=a[Y]=a[F]=!1;var _e=typeof global=="object"&&global&&global.Object===Object&&global,me=typeof self=="object"&&self&&self.Object===Object&&self,d=_e||me||Function("return this")(),Rt=typeof A=="object"&&A&&!A.nodeType&&A,ut=Rt&&typeof j=="object"&&j&&!j.nodeType&&j,$e=ut&&ut.exports===Rt;function ve(t,e){return t.set(e[0],e[1]),t}function je(t,e){return t.add(e),t}function Oe(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function Se(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function Bt(t,e,r,n){var o=-1,c=t?t.length:0;for(n&&c&&(r=t[++o]);++o<c;)r=e(r,t[o],o,t);return r}function xe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function we(t,e){return t==null?void 0:t[e]}function Gt(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function lt(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Z(t,e){return function(r){return t(e(r))}}function ft(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Te=Array.prototype,Ae=Function.prototype,K=Object.prototype,k=d["__core-js_shared__"],pt=function(){var t=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),kt=Ae.toString,y=K.hasOwnProperty,V=K.toString,Ee=RegExp("^"+kt.call(y).replace(he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dt=$e?d.Buffer:void 0,ht=d.Symbol,gt=d.Uint8Array,Ce=Z(Object.getPrototypeOf,Object),Ie=Object.create,Pe=K.propertyIsEnumerable,De=Te.splice,yt=Object.getOwnPropertySymbols,Ne=dt?dt.isBuffer:void 0,Ke=Z(Object.keys,Object),H=x(d,"DataView"),E=x(d,"Map"),L=x(d,"Promise"),U=x(d,"Set"),J=x(d,"WeakMap"),C=x(Object,"create"),Ve=$(H),Me=$(E),Re=$(L),Be=$(U),Ge=$(J),bt=ht?ht.prototype:void 0,_t=bt?bt.valueOf:void 0;function m(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ke(){this.__data__=C?C(null):{}}function Fe(t){return this.has(t)&&delete this.__data__[t]}function He(t){var e=this.__data__;if(C){var r=e[t];return r===mt?void 0:r}return y.call(e,t)?e[t]:void 0}function Le(t){var e=this.__data__;return C?e[t]!==void 0:y.call(e,t)}function Ue(t,e){var r=this.__data__;return r[t]=C&&e===void 0?mt:e,this}m.prototype.clear=ke;m.prototype.delete=Fe;m.prototype.get=He;m.prototype.has=Le;m.prototype.set=Ue;function h(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Je(){this.__data__=[]}function We(t){var e=this.__data__,r=M(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():De.call(e,r,1),!0}function qe(t){var e=this.__data__,r=M(e,t);return r<0?void 0:e[r][1]}function Ye(t){return M(this.__data__,t)>-1}function Xe(t,e){var r=this.__data__,n=M(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}h.prototype.clear=Je;h.prototype.delete=We;h.prototype.get=qe;h.prototype.has=Ye;h.prototype.set=Xe;function O(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ze(){this.__data__={hash:new m,map:new(E||h),string:new m}}function Qe(t){return R(this,t).delete(t)}function ze(t){return R(this,t).get(t)}function tr(t){return R(this,t).has(t)}function er(t,e){return R(this,t).set(t,e),this}O.prototype.clear=Ze;O.prototype.delete=Qe;O.prototype.get=ze;O.prototype.has=tr;O.prototype.set=er;function S(t){this.__data__=new h(t)}function rr(){this.__data__=new h}function nr(t){return this.__data__.delete(t)}function or(t){return this.__data__.get(t)}function ar(t){return this.__data__.has(t)}function ir(t,e){var r=this.__data__;if(r instanceof h){var n=r.__data__;if(!E||n.length<fe-1)return n.push([t,e]),this;r=this.__data__=new O(n)}return r.set(t,e),this}S.prototype.clear=rr;S.prototype.delete=nr;S.prototype.get=or;S.prototype.has=ar;S.prototype.set=ir;function sr(t,e){var r=z(t)||Ir(t)?xe(t.length,String):[],n=r.length,o=!!n;for(var c in t)(e||y.call(t,c))&&!(o&&(c=="length"||Tr(c,n)))&&r.push(c);return r}function Ft(t,e,r){var n=t[e];(!(y.call(t,e)&&Jt(n,r))||r===void 0&&!(e in t))&&(t[e]=r)}function M(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1}function cr(t,e){return t&&Ht(e,tt(e),t)}function W(t,e,r,n,o,c,f){var s;if(n&&(s=c?n(t,o,c,f):n(t)),s!==void 0)return s;if(!B(t))return t;var l=z(t);if(l){if(s=Sr(t),!e)return vr(t,s)}else{var p=_(t),u=p==Y||p==Ot;if(Dr(t))return hr(t,e);if(p==X||p==q||u&&!c){if(Gt(t))return c?t:{};if(s=xr(u?{}:t),!e)return jr(t,cr(s,t))}else{if(!a[p])return c?t:{};s=wr(t,p,W,e)}}f||(f=new S);var i=f.get(t);if(i)return i;if(f.set(t,s),!l)var g=r?Or(t):tt(t);return Oe(g||t,function(b,I){g&&(I=b,b=t[I]),Ft(s,I,W(b,e,r,n,I,t,f))}),s}function ur(t){return B(t)?Ie(t):{}}function lr(t,e,r){var n=e(t);return z(t)?n:Se(n,r(t))}function fr(t){return V.call(t)}function pr(t){if(!B(t)||Er(t))return!1;var e=qt(t)||Gt(t)?Ee:ye;return e.test($(t))}function dr(t){if(!Ut(t))return Ke(t);var e=[];for(var r in Object(t))y.call(t,r)&&r!="constructor"&&e.push(r);return e}function hr(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function Q(t){var e=new t.constructor(t.byteLength);return new gt(e).set(new gt(t)),e}function gr(t,e){var r=e?Q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function yr(t,e,r){var n=e?r(lt(t),!0):lt(t);return Bt(n,ve,new t.constructor)}function br(t){var e=new t.constructor(t.source,ge.exec(t));return e.lastIndex=t.lastIndex,e}function _r(t,e,r){var n=e?r(ft(t),!0):ft(t);return Bt(n,je,new t.constructor)}function mr(t){return _t?Object(_t.call(t)):{}}function $r(t,e){var r=e?Q(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function vr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Ht(t,e,r,n){r||(r={});for(var o=-1,c=e.length;++o<c;){var f=e[o],s=n?n(r[f],t[f],f,r,t):void 0;Ft(r,f,s===void 0?t[f]:s)}return r}function jr(t,e){return Ht(t,Lt(t),e)}function Or(t){return lr(t,tt,Lt)}function R(t,e){var r=t.__data__;return Ar(e)?r[typeof e=="string"?"string":"hash"]:r.map}function x(t,e){var r=we(t,e);return pr(r)?r:void 0}var Lt=yt?Z(yt,Object):Vr,_=fr;(H&&_(new H(new ArrayBuffer(1)))!=N||E&&_(new E)!=P||L&&_(L.resolve())!=ct||U&&_(new U)!=D||J&&_(new J)!=F)&&(_=function(t){var e=V.call(t),r=e==X?t.constructor:void 0,n=r?$(r):void 0;if(n)switch(n){case Ve:return N;case Me:return P;case Re:return ct;case Be:return D;case Ge:return F}return e});function Sr(t){var e=t.length,r=t.constructor(e);return e&&typeof t[0]=="string"&&y.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function xr(t){return typeof t.constructor=="function"&&!Ut(t)?ur(Ce(t)):{}}function wr(t,e,r,n){var o=t.constructor;switch(e){case At:return Q(t);case vt:case jt:return new o(+t);case N:return gr(t,n);case Et:case Ct:case It:case Pt:case Dt:case Nt:case Kt:case Vt:case Mt:return $r(t,n);case P:return yr(t,n,r);case St:case wt:return new o(t);case xt:return br(t);case D:return _r(t,n,r);case Tt:return mr(t)}}function Tr(t,e){return e=e==null?$t:e,!!e&&(typeof t=="number"||be.test(t))&&t>-1&&t%1==0&&t<e}function Ar(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Er(t){return!!pt&&pt in t}function Ut(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||K;return t===r}function $(t){if(t!=null){try{return kt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Cr(t){return W(t,!0,!0)}function Jt(t,e){return t===e||t!==t&&e!==e}function Ir(t){return Pr(t)&&y.call(t,"callee")&&(!Pe.call(t,"callee")||V.call(t)==q)}var z=Array.isArray;function Wt(t){return t!=null&&Nr(t.length)&&!qt(t)}function Pr(t){return Kr(t)&&Wt(t)}var Dr=Ne||Mr;function qt(t){var e=B(t)?V.call(t):"";return e==Y||e==Ot}function Nr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$t}function B(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Kr(t){return!!t&&typeof t=="object"}function tt(t){return Wt(t)?sr(t):dr(t)}function Vr(){return[]}function Mr(){return!1}j.exports=Cr});var zt=at((tn,Qt)=>{var Rr="[object Object]";function Br(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function Gr(t,e){return function(r){return t(e(r))}}var kr=Function.prototype,Xt=Object.prototype,Zt=kr.toString,Fr=Xt.hasOwnProperty,Hr=Zt.call(Object),Lr=Xt.toString,Ur=Gr(Object.getPrototypeOf,Object);function Jr(t){return!!t&&typeof t=="object"}function Wr(t){if(!Jr(t)||Lr.call(t)!=Rr||Br(t))return!1;var e=Ur(t);if(e===null)return!0;var r=Fr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Zt.call(r)==Hr}Qt.exports=Wr});var Qr={};ue(Qr,{traverse:()=>Zr,version:()=>Xr});var G=st(Yt(),1),ee=st(zt(),1);function qr(t){if(t.includes(".")){let e=t.lastIndexOf(".");if(!t.slice(0,e).includes("."))return t.slice(0,e);for(let r=e-1;r--;)if(t[r]===".")return t.slice(r+1,e)}return null}var et=qr;var te="3.0.13";var Xr=te;function Zr(t,e){let r={now:!1};function n(o,c,f,s){let l=(0,G.default)(o),p,u=v({depth:-1,path:""},f);if(u.depth+=1,Array.isArray(l))for(let i=0,g=l.length;i<g&&!s.now;i++){let b=u.path?`${u.path}.${i}`:`${i}`;l[i]!==void 0?(u.parent=(0,G.default)(l),u.parentType="array",u.parentKey=et(b),p=n(c(l[i],void 0,T(v({},u),{path:b}),s),c,T(v({},u),{path:b}),s),Number.isNaN(p)&&i<l.length?(l.splice(i,1),i-=1):l[i]=p):l.splice(i,1)}else if((0,ee.default)(l))for(let i in l){if(s.now&&i!=null)break;let g=u.path?`${u.path}.${i}`:i;u.depth===0&&i!=null&&(u.topmostKey=i),u.parent=(0,G.default)(l),u.parentType="object",u.parentKey=et(g),p=n(c(i,l[i],T(v({},u),{path:g}),s),c,T(v({},u),{path:g}),s),Number.isNaN(p)?delete l[i]:l[i]=p}return l}return n(t,e,{},r)}return le(Qr);})();
/**
* @name ast-monkey-util
* @fileoverview Utility library of AST helper functions
* @version 2.0.12
* @version 2.0.13
* @author Roy Revelt, Codsen Ltd

@@ -17,0 +17,0 @@ * @license MIT

{
"name": "ast-monkey-traverse",
"version": "3.0.12",
"version": "3.0.13",
"description": "Utility library to traverse AST",

@@ -81,3 +81,3 @@ "keywords": [

"dependencies": {
"ast-monkey-util": "^2.0.12",
"ast-monkey-util": "^2.0.13",
"lodash.clonedeep": "^4.5.0",

@@ -84,0 +84,0 @@ "lodash.isplainobject": "^4.0.6"

@@ -29,3 +29,3 @@ # ast-monkey-traverse

The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `2.1.0`.
This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 2.1.0 (`npm i ast-monkey-traverse@2.1.0`).

@@ -32,0 +32,0 @@ ```bash

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc