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