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