ast-monkey-traverse 3.0.13 → 3.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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ast-monkey-traverse
|
|
3
3
|
* @fileoverview Utility library to traverse AST
|
|
4
|
-
* @version 3.0.
|
|
4
|
+
* @version 3.0.14
|
|
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 p from"lodash.clonedeep";import g from"lodash.isplainobject";import{parent as
|
|
10
|
+
import p from"lodash.clonedeep";import g from"lodash.isplainobject";import{parent as y}from"ast-monkey-util";var u="3.0.14";var D=u;function k(m,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=y(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=y(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(m,c,{},d)}export{k as traverse,D as version};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";/**
|
|
2
2
|
* @name ast-monkey-traverse
|
|
3
3
|
* @fileoverview Utility library to traverse AST
|
|
4
|
-
* @version 3.0.
|
|
4
|
+
* @version 3.0.14
|
|
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
|
-
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);})();
|
|
10
|
+
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.14";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);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name ast-monkey-util
|
|
13
13
|
* @fileoverview Utility library of AST helper functions
|
|
14
|
-
* @version 2.0.
|
|
14
|
+
* @version 2.0.14
|
|
15
15
|
* @author Roy Revelt, Codsen Ltd
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@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": "3.0.
|
|
3
|
+
"version": "3.0.14",
|
|
4
4
|
"description": "Utility library to traverse AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"type": "module",
|
|
41
41
|
"exports": {
|
|
42
|
+
"types": "./types/index.d.ts",
|
|
42
43
|
"script": "./dist/ast-monkey-traverse.umd.js",
|
|
43
44
|
"default": "./dist/ast-monkey-traverse.esm.js"
|
|
44
45
|
},
|
|
@@ -78,13 +79,13 @@
|
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
81
|
"dependencies": {
|
|
81
|
-
"ast-monkey-util": "^2.0.
|
|
82
|
+
"ast-monkey-util": "^2.0.14",
|
|
82
83
|
"lodash.clonedeep": "^4.5.0",
|
|
83
84
|
"lodash.isplainobject": "^4.0.6"
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|
|
86
|
-
"@types/lodash.clonedeep": "^4.5.
|
|
87
|
-
"@types/lodash.isplainobject": "^4.0.
|
|
87
|
+
"@types/lodash.clonedeep": "^4.5.7",
|
|
88
|
+
"@types/lodash.isplainobject": "^4.0.7",
|
|
88
89
|
"lodash.isequal": "^4.5.0"
|
|
89
90
|
}
|
|
90
91
|
}
|