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