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

ast-monkey-traverse

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-monkey-traverse - npm Package Compare versions

Comparing version 1.12.2 to 1.12.3

2

dist/ast-monkey-traverse.cjs.js
/**
* ast-monkey-traverse
* Utility library to traverse parsed HTML (AST's) or anything nested (plain objects within arrays within plain objects)
* Version: 1.12.2
* Version: 1.12.3
* Author: Roy Revelt, Codsen Ltd

@@ -6,0 +6,0 @@ * License: MIT

/**
* ast-monkey-traverse
* Utility library to traverse parsed HTML (AST's) or anything nested (plain objects within arrays within plain objects)
* Version: 1.12.2
* Version: 1.12.3
* Author: Roy Revelt, Codsen Ltd

@@ -6,0 +6,0 @@ * License: MIT

/**
* ast-monkey-traverse
* Utility library to traverse parsed HTML (AST's) or anything nested (plain objects within arrays within plain objects)
* Version: 1.12.2
* Version: 1.12.3
* Author: Roy Revelt, Codsen Ltd

@@ -10,2 +10,2 @@ * License: MIT

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).astMonkeyTraverse=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var e=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(e,r){var n=200,o="__lodash_hash_undefined__",c=9007199254740991,u="[object Arguments]",a="[object Boolean]",i="[object Date]",f="[object Function]",s="[object GeneratorFunction]",l="[object Map]",p="[object Number]",y="[object Object]",h="[object RegExp]",_="[object Set]",b="[object String]",v="[object Symbol]",d="[object ArrayBuffer]",j="[object DataView]",g="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",m="[object Int16Array]",A="[object Int32Array]",x="[object Uint8Array]",S="[object Uint8ClampedArray]",P="[object Uint16Array]",k="[object Uint32Array]",T=/\w*$/,$=/^\[object .+?Constructor\]$/,E=/^(?:0|[1-9]\d*)$/,F={};F[u]=F["[object Array]"]=F[d]=F[j]=F[a]=F[i]=F[g]=F[w]=F[O]=F[m]=F[A]=F[l]=F[p]=F[y]=F[h]=F[_]=F[b]=F[v]=F[x]=F[S]=F[P]=F[k]=!0,F["[object Error]"]=F[f]=F["[object WeakMap]"]=!1;var I="object"==typeof t&&t&&t.Object===Object&&t,M="object"==typeof self&&self&&self.Object===Object&&self,N=I||M||Function("return this")(),B=r&&!r.nodeType&&r,U=B&&e&&!e.nodeType&&e,W=U&&U.exports===B;function D(t,e){return t.set(e[0],e[1]),t}function R(t,e){return t.add(e),t}function z(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 C(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function L(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function V(t,e){return function(r){return t(e(r))}}function G(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var K,q=Array.prototype,H=Function.prototype,J=Object.prototype,Q=N["__core-js_shared__"],X=(K=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",Y=H.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=W?N.Buffer:void 0,nt=N.Symbol,ot=N.Uint8Array,ct=V(Object.getPrototypeOf,Object),ut=Object.create,at=J.propertyIsEnumerable,it=q.splice,ft=Object.getOwnPropertySymbols,st=rt?rt.isBuffer:void 0,lt=V(Object.keys,Object),pt=Ut(N,"DataView"),yt=Ut(N,"Map"),ht=Ut(N,"Promise"),_t=Ut(N,"Set"),bt=Ut(N,"WeakMap"),vt=Ut(Object,"create"),dt=Ct(pt),jt=Ct(yt),gt=Ct(ht),wt=Ct(_t),Ot=Ct(bt),mt=nt?nt.prototype:void 0,At=mt?mt.valueOf:void 0;function xt(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 St(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 Pt(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 kt(t){this.__data__=new St(t)}function Tt(t,e){var r=Vt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Gt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==u)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var c in t)!e&&!Z.call(t,c)||o&&("length"==c||Rt(c,n))||r.push(c);return r}function $t(t,e,r){var n=t[e];Z.call(t,e)&&Lt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Et(t,e){for(var r=t.length;r--;)if(Lt(t[r][0],e))return r;return-1}function Ft(t,e,r,n,o,c,$){var E;if(n&&(E=c?n(t,o,c,$):n(t)),void 0!==E)return E;if(!Ht(t))return t;var I=Vt(t);if(I){if(E=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,E)}else{var M=Dt(t),N=M==f||M==s;if(Kt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(M==y||M==u||N&&!c){if(C(t))return c?t:{};if(E=function(t){return"function"!=typeof t.constructor||zt(t)?{}:(e=ct(t),Ht(e)?ut(e):{});var e}(N?{}:t),!e)return function(t,e){return Nt(t,Wt(t),e)}(t,function(t,e){return t&&Nt(e,Jt(e),t)}(E,t))}else{if(!F[M])return c?t:{};E=function(t,e,r,n){var o=t.constructor;switch(e){case d:return Mt(t);case a:case i:return new o(+t);case j:return function(t,e){var r=e?Mt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case g:case w:case O:case m:case A:case x:case S:case P:case k:return function(t,e){var r=e?Mt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case l:return function(t,e,r){return z(e?r(L(t),!0):L(t),D,new t.constructor)}(t,n,r);case p:case b:return new o(t);case h:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case _:return function(t,e,r){return z(e?r(G(t),!0):G(t),R,new t.constructor)}(t,n,r);case v:return c=t,At?Object(At.call(c)):{}}var c}(t,M,Ft,e)}}$||($=new kt);var B=$.get(t);if(B)return B;if($.set(t,E),!I)var U=r?function(t){return function(t,e,r){var n=e(t);return Vt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Jt,Wt)}(t):Jt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(U||t,(function(o,c){U&&(o=t[c=o]),$t(E,c,Ft(o,e,r,n,c,t,$))})),E}function It(t){return!(!Ht(t)||(e=t,X&&X in e))&&(qt(t)||C(t)?et:$).test(Ct(t));var e}function Mt(t){var e=new t.constructor(t.byteLength);return new ot(e).set(new ot(t)),e}function Nt(t,e,r,n){r||(r={});for(var o=-1,c=e.length;++o<c;){var u=e[o],a=n?n(r[u],t[u],u,r,t):void 0;$t(r,u,void 0===a?t[u]:a)}return r}function Bt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Ut(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return It(r)?r:void 0}xt.prototype.clear=function(){this.__data__=vt?vt(null):{}},xt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},xt.prototype.get=function(t){var e=this.__data__;if(vt){var r=e[t];return r===o?void 0:r}return Z.call(e,t)?e[t]:void 0},xt.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},xt.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?o:e,this},St.prototype.clear=function(){this.__data__=[]},St.prototype.delete=function(t){var e=this.__data__,r=Et(e,t);return!(r<0)&&(r==e.length-1?e.pop():it.call(e,r,1),!0)},St.prototype.get=function(t){var e=this.__data__,r=Et(e,t);return r<0?void 0:e[r][1]},St.prototype.has=function(t){return Et(this.__data__,t)>-1},St.prototype.set=function(t,e){var r=this.__data__,n=Et(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Pt.prototype.clear=function(){this.__data__={hash:new xt,map:new(yt||St),string:new xt}},Pt.prototype.delete=function(t){return Bt(this,t).delete(t)},Pt.prototype.get=function(t){return Bt(this,t).get(t)},Pt.prototype.has=function(t){return Bt(this,t).has(t)},Pt.prototype.set=function(t,e){return Bt(this,t).set(t,e),this},kt.prototype.clear=function(){this.__data__=new St},kt.prototype.delete=function(t){return this.__data__.delete(t)},kt.prototype.get=function(t){return this.__data__.get(t)},kt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof St){var o=r.__data__;if(!yt||o.length<n-1)return o.push([t,e]),this;r=this.__data__=new Pt(o)}return r.set(t,e),this};var Wt=ft?V(ft,Object):function(){return[]},Dt=function(t){return tt.call(t)};function Rt(t,e){return!!(e=null==e?c:e)&&("number"==typeof t||E.test(t))&&t>-1&&t%1==0&&t<e}function zt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Ct(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Lt(t,e){return t===e||t!=t&&e!=e}(pt&&Dt(new pt(new ArrayBuffer(1)))!=j||yt&&Dt(new yt)!=l||ht&&"[object Promise]"!=Dt(ht.resolve())||_t&&Dt(new _t)!=_||bt&&"[object WeakMap]"!=Dt(new bt))&&(Dt=function(t){var e=tt.call(t),r=e==y?t.constructor:void 0,n=r?Ct(r):void 0;if(n)switch(n){case dt:return j;case jt:return l;case gt:return"[object Promise]";case wt:return _;case Ot:return"[object WeakMap]"}return e});var Vt=Array.isArray;function Gt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=c}(t.length)&&!qt(t)}var Kt=st||function(){return!1};function qt(t){var e=Ht(t)?tt.call(t):"";return e==f||e==s}function Ht(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Gt(t)?Tt(t):function(t){if(!zt(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}e.exports=function(t){return Ft(t,!0,!0)}})),r="[object Object]";var n,o,c=Function.prototype,u=Object.prototype,a=c.toString,i=u.hasOwnProperty,f=a.call(Object),s=u.toString,l=(n=Object.getPrototypeOf,o=Object,function(t){return n(o(t))});var p=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||s.call(t)!=r||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=l(t);if(null===e)return!0;var n=i.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==f},y=Array.isArray;function h(t){return"string"==typeof t&&t.length>0&&"."===t[0]?t.slice(1):t}return function(t,r){return function t(r,n,o,c){var u,a,i,f,s,l=e(r);if((o=Object.assign({depth:-1,path:""},o)).depth+=1,y(l))for(u=0,a=l.length;u<a&&!c.now;u++){var _="".concat(o.path,".").concat(u);void 0!==l[u]?(o.parent=e(l),o.parentType="array",i=t(n(l[u],void 0,Object.assign({},o,{path:h(_)}),c),n,Object.assign({},o,{path:h(_)}),c),Number.isNaN(i)&&u<l.length?(l.splice(u,1),u-=1):l[u]=i):l.splice(u,1)}else if(p(l))for(u=0,a=(f=Object.keys(l)).length;u<a&&!c.now;u++){s=f[u];var b="".concat(o.path,".").concat(s);0===o.depth&&null!=s&&(o.topmostKey=s),o.parent=e(l),o.parentType="object",i=t(n(s,l[s],Object.assign({},o,{path:h(b)}),c),n,Object.assign({},o,{path:h(b)}),c),Number.isNaN(i)?delete l[s]:l[s]=i}return l}(t,r,{},{now:!1})}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).astMonkeyTraverse=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var e=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(e,r){var n="[object Arguments]",o="[object Function]",c="[object GeneratorFunction]",a="[object Map]",u="[object Set]",i=/\w*$/,f=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,l={};l[n]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object DataView]"]=l["[object Boolean]"]=l["[object Date]"]=l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l[a]=l["[object Number]"]=l["[object Object]"]=l["[object RegExp]"]=l[u]=l["[object String]"]=l["[object Symbol]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l["[object Error]"]=l[o]=l["[object WeakMap]"]=!1;var p="object"==typeof t&&t&&t.Object===Object&&t,b="object"==typeof self&&self&&self.Object===Object&&self,y=p||b||Function("return this")(),h=r&&!r.nodeType&&r,_=h&&e&&!e.nodeType&&e,j=_&&_.exports===h;function v(t,e){return t.set(e[0],e[1]),t}function d(t,e){return t.add(e),t}function g(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 w(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function O(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function A(t,e){return function(r){return t(e(r))}}function m(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var x,S=Array.prototype,I=Function.prototype,P=Object.prototype,k=y["__core-js_shared__"],F=(x=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",U=I.toString,E=P.hasOwnProperty,N=P.toString,T=RegExp("^"+U.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=j?y.Buffer:void 0,B=y.Symbol,D=y.Uint8Array,M=A(Object.getPrototypeOf,Object),V=Object.create,R=P.propertyIsEnumerable,W=S.splice,C=Object.getOwnPropertySymbols,z=$?$.isBuffer:void 0,L=A(Object.keys,Object),G=_t(y,"DataView"),K=_t(y,"Map"),q=_t(y,"Promise"),H=_t(y,"Set"),J=_t(y,"WeakMap"),Q=_t(Object,"create"),X=wt(G),Y=wt(K),Z=wt(q),tt=wt(H),et=wt(J),rt=B?B.prototype:void 0,nt=rt?rt.valueOf:void 0;function ot(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 ct(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 at(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 ut(t){this.__data__=new ct(t)}function it(t,e){var r=At(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&mt(t)}(t)&&E.call(t,"callee")&&(!R.call(t,"callee")||N.call(t)==n)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],o=r.length,c=!!o;for(var a in t)!e&&!E.call(t,a)||c&&("length"==a||dt(a,o))||r.push(a);return r}function ft(t,e,r){var n=t[e];E.call(t,e)&&Ot(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function st(t,e){for(var r=t.length;r--;)if(Ot(t[r][0],e))return r;return-1}function lt(t,e,r,f,s,p,b){var y;if(f&&(y=p?f(t,s,p,b):f(t)),void 0!==y)return y;if(!It(t))return t;var h=At(t);if(h){if(y=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&E.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,y)}else{var _=vt(t),j=_==o||_==c;if(xt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if("[object Object]"==_||_==n||j&&!p){if(w(t))return p?t:{};if(y=function(t){return"function"!=typeof t.constructor||gt(t)?{}:(e=M(t),It(e)?V(e):{});var e}(j?{}:t),!e)return function(t,e){return yt(t,jt(t),e)}(t,function(t,e){return t&&yt(e,Pt(e),t)}(y,t))}else{if(!l[_])return p?t:{};y=function(t,e,r,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return bt(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?bt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var r=e?bt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case a:return function(t,e,r){return g(e?r(O(t),!0):O(t),v,new t.constructor)}(t,n,r);case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,i.exec(t));return e.lastIndex=t.lastIndex,e}(t);case u:return function(t,e,r){return g(e?r(m(t),!0):m(t),d,new t.constructor)}(t,n,r);case"[object Symbol]":return c=t,nt?Object(nt.call(c)):{}}var c}(t,_,lt,e)}}b||(b=new ut);var A=b.get(t);if(A)return A;if(b.set(t,y),!h)var x=r?function(t){return function(t,e,r){var n=e(t);return At(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Pt,jt)}(t):Pt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(x||t,(function(n,o){x&&(n=t[o=n]),ft(y,o,lt(n,e,r,f,o,t,b))})),y}function pt(t){return!(!It(t)||(e=t,F&&F in e))&&(St(t)||w(t)?T:f).test(wt(t));var e}function bt(t){var e=new t.constructor(t.byteLength);return new D(e).set(new D(t)),e}function yt(t,e,r,n){r||(r={});for(var o=-1,c=e.length;++o<c;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;ft(r,a,void 0===u?t[a]:u)}return r}function ht(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function _t(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return pt(r)?r:void 0}ot.prototype.clear=function(){this.__data__=Q?Q(null):{}},ot.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},ot.prototype.get=function(t){var e=this.__data__;if(Q){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return E.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return Q?void 0!==e[t]:E.call(e,t)},ot.prototype.set=function(t,e){return this.__data__[t]=Q&&void 0===e?"__lodash_hash_undefined__":e,this},ct.prototype.clear=function(){this.__data__=[]},ct.prototype.delete=function(t){var e=this.__data__,r=st(e,t);return!(r<0)&&(r==e.length-1?e.pop():W.call(e,r,1),!0)},ct.prototype.get=function(t){var e=this.__data__,r=st(e,t);return r<0?void 0:e[r][1]},ct.prototype.has=function(t){return st(this.__data__,t)>-1},ct.prototype.set=function(t,e){var r=this.__data__,n=st(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new ot,map:new(K||ct),string:new ot}},at.prototype.delete=function(t){return ht(this,t).delete(t)},at.prototype.get=function(t){return ht(this,t).get(t)},at.prototype.has=function(t){return ht(this,t).has(t)},at.prototype.set=function(t,e){return ht(this,t).set(t,e),this},ut.prototype.clear=function(){this.__data__=new ct},ut.prototype.delete=function(t){return this.__data__.delete(t)},ut.prototype.get=function(t){return this.__data__.get(t)},ut.prototype.has=function(t){return this.__data__.has(t)},ut.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ct){var n=r.__data__;if(!K||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var jt=C?A(C,Object):function(){return[]},vt=function(t){return N.call(t)};function dt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||s.test(t))&&t>-1&&t%1==0&&t<e}function gt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||P)}function wt(t){if(null!=t){try{return U.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ot(t,e){return t===e||t!=t&&e!=e}(G&&"[object DataView]"!=vt(new G(new ArrayBuffer(1)))||K&&vt(new K)!=a||q&&"[object Promise]"!=vt(q.resolve())||H&&vt(new H)!=u||J&&"[object WeakMap]"!=vt(new J))&&(vt=function(t){var e=N.call(t),r="[object Object]"==e?t.constructor:void 0,n=r?wt(r):void 0;if(n)switch(n){case X:return"[object DataView]";case Y:return a;case Z:return"[object Promise]";case tt:return u;case et:return"[object WeakMap]"}return e});var At=Array.isArray;function mt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!St(t)}var xt=z||function(){return!1};function St(t){var e=It(t)?N.call(t):"";return e==o||e==c}function It(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Pt(t){return mt(t)?it(t):function(t){if(!gt(t))return L(t);var e=[];for(var r in Object(t))E.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}e.exports=function(t){return lt(t,!0,!0)}}));var r,n,o=Function.prototype,c=Object.prototype,a=o.toString,u=c.hasOwnProperty,i=a.call(Object),f=c.toString,s=(r=Object.getPrototypeOf,n=Object,function(t){return r(n(t))});var l=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=f.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=s(t);if(null===e)return!0;var r=u.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==i},p=Array.isArray;function b(t){return"string"==typeof t&&t.length>0&&"."===t[0]?t.slice(1):t}return function(t,r){return function t(r,n,o,c){var a,u,i,f,s,y=e(r);if((o=Object.assign({depth:-1,path:""},o)).depth+=1,p(y))for(a=0,u=y.length;a<u&&!c.now;a++){var h="".concat(o.path,".").concat(a);void 0!==y[a]?(o.parent=e(y),o.parentType="array",i=t(n(y[a],void 0,Object.assign({},o,{path:b(h)}),c),n,Object.assign({},o,{path:b(h)}),c),Number.isNaN(i)&&a<y.length?(y.splice(a,1),a-=1):y[a]=i):y.splice(a,1)}else if(l(y))for(a=0,u=(f=Object.keys(y)).length;a<u&&!c.now;a++){s=f[a];var _="".concat(o.path,".").concat(s);0===o.depth&&null!=s&&(o.topmostKey=s),o.parent=e(y),o.parentType="object",i=t(n(s,y[s],Object.assign({},o,{path:b(_)}),c),n,Object.assign({},o,{path:b(_)}),c),Number.isNaN(i)?delete y[s]:y[s]=i}return y}(t,r,{},{now:!1})}}));
{
"name": "ast-monkey-traverse",
"version": "1.12.2",
"version": "1.12.3",
"description": "Utility library to traverse parsed HTML (AST's) or anything nested (plain objects within arrays within plain objects)",

@@ -35,4 +35,4 @@ "license": "MIT",

"scripts": {
"build": "rollup -c --silent",
"dev": "rollup -c --dev --silent",
"build": "rollup -c",
"dev": "rollup -c --dev",
"devunittest": "npm run dev && ./node_modules/.bin/tap --only",

@@ -133,10 +133,10 @@ "format": "npm run lect && npm run prettier && npm run lint",

"devDependencies": {
"@babel/core": "^7.7.5",
"@babel/preset-env": "^7.7.6",
"@babel/core": "^7.7.7",
"@babel/preset-env": "^7.7.7",
"benchmark": "^2.1.4",
"js-row-num-cli": "^1.6.11",
"lect": "^0.11.4",
"js-row-num-cli": "^1.6.13",
"lect": "^0.11.7",
"lodash.isequal": "^4.5.0",
"object-path": "^0.11.4",
"rollup": "^1.27.13",
"rollup": "^1.29.0",
"rollup-plugin-ascii": "^0.0.3",

@@ -151,4 +151,4 @@ "rollup-plugin-babel": "^4.3.3",

"rollup-plugin-terser": "^5.1.3",
"tap": "^14.10.2"
"tap": "^14.10.5"
}
}

@@ -1,4 +0,6 @@

# ast-monkey-traverse
<div align="center">
<h1>🐒<br>ast-monkey-traverse</h1>
</div>
> Utility library to traverse parsed HTML (AST's) or anything nested (plain objects within arrays within plain objects)
<div align="center"><p>Utility library to traverse parsed HTML (AST's) or anything nested (plain objects within arrays within plain objects)</p></div>

@@ -14,3 +16,3 @@ [![Minimum Node version required][node-img]][node-url]

- Check out the parent library which does even more: [ast-monkey](https://gitlab.com/codsen/codsen/tree/master/packages/ast-monkey/)
- Check out the parent library which does even more: `ast-monkey` ([npm](https://www.npmjs.com/package/ast-monkey)/[monorepo](https://gitlab.com/codsen/codsen/tree/master/packages/ast-monkey/))

@@ -63,3 +65,3 @@ ## Table of Contents

| **ES module** build that Webpack/Rollup understands. Untranspiled ES6 code with `import`/`export`. | `module` | `dist/ast-monkey-traverse.esm.js` | 3 KB |
| **UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/ast-monkey-traverse.umd.js` | 10 KB |
| **UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/ast-monkey-traverse.umd.js` | 11 KB |

@@ -130,3 +132,3 @@ **[⬆ back to top](#)**

Normally, you don't want to stop the traversal. For example, here we gather all the traversed paths. Remember the format is universal, you can use it in [`object-path`](https://www.npmjs.com/package/object-path) for example.
Here's how to stop the traversal. Let's gather all the traversed paths first. By the way, paths are marked in [object-path](https://www.npmjs.com/package/object-path) notation (arrays use dots too, `a.1.b` instead of `a[1].b`).

@@ -146,2 +148,4 @@ ```js

All paths were gathered: `["a", "b", "b.c"]`.
Now let's make the monkey to stop at the path "b":

@@ -165,3 +169,3 @@

Notice how there were no more gathered paths after "b".
Notice how there were no more gathered paths after "b", only `["a", "b"]`.

@@ -179,3 +183,3 @@ **[⬆ back to top](#)**

The npm script "`dev`", the `"dev": "rollup -c --dev --silent"` builds the development version retaining all `console.log`s with row numbers. It's handy to have [js-row-num-cli](https://www.npmjs.com/package/js-row-num-cli) installed globally so you can automatically update the row numbers on all `console.log`s.
The npm script "`dev`", the `"dev": "rollup -c --dev"` builds the development version retaining all `console.log`s with row numbers. It's handy to have [js-row-num-cli](https://www.npmjs.com/package/js-row-num-cli) installed globally so you can automatically update the row numbers on all `console.log`s.

@@ -188,3 +192,3 @@ **[⬆ back to top](#)**

Copyright (c) 2015-2019 Roy Revelt and other contributors
Copyright (c) 2015-2020 Roy Revelt and other contributors

@@ -191,0 +195,0 @@ [node-img]: https://img.shields.io/node/v/ast-monkey-traverse.svg?style=flat-square&label=works%20on%20node

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc