ast-monkey
Version:
Traverse and edit AST
88 lines (85 loc) • 38.3 kB
JavaScript
/**
* @name ast-monkey
* @fileoverview Traverse and edit AST
* @version 9.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/ast-monkey/}
*/
;var astMonkey=(()=>{var jt=Object.create,ve=Object.freeze,R=Object.defineProperty,$t=Object.defineProperties,kt=Object.getOwnPropertyDescriptor,Et=Object.getOwnPropertyDescriptors,It=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols,Pt=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable;var Oe=(e,t,r)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))Se.call(t,r)&&Oe(e,r,t[r]);if(we)for(var r of we(t))Dt.call(t,r)&&Oe(e,r,t[r]);return e},E=(e,t)=>$t(e,Et(t));var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Nt=(e,t)=>{for(var r in t)R(e,r,{get:t[r],enumerable:!0})},Ae=(e,t,r,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of It(t))!Se.call(e,p)&&p!==r&&R(e,p,{get:()=>t[p],enumerable:!(l=kt(t,p))||l.enumerable});return e};var H=(e,t,r)=>(r=e!=null?jt(Pt(e)):{},Ae(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e)),Wt=e=>Ae(R({},"__esModule",{value:!0}),e);var z=(e,t)=>ve(R(e,"raw",{value:ve(t||e.slice())}));var mt=q((ue,pe)=>{(function(e,t){typeof ue=="object"&&typeof pe<"u"?pe.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=t())})(ue,(function(){"use strict";var e=typeof Promise=="function",t=(function(g){if(typeof globalThis=="object")return globalThis;Object.defineProperty(g,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var D=typeDetectGlobalObject;return delete g.typeDetectGlobalObject,D})(Object.prototype),r=typeof Symbol<"u",l=typeof Map<"u",p=typeof Set<"u",d=typeof WeakMap<"u",c=typeof WeakSet<"u",o=typeof DataView<"u",a=r&&typeof Symbol.iterator<"u",n=r&&typeof Symbol.toStringTag<"u",i=p&&typeof Set.prototype.entries=="function",s=l&&typeof Map.prototype.entries=="function",u=i&&Object.getPrototypeOf(new Set().entries()),S=s&&Object.getPrototypeOf(new Map().entries()),b=a&&typeof Array.prototype[Symbol.iterator]=="function",j=b&&Object.getPrototypeOf([][Symbol.iterator]()),y=a&&typeof String.prototype[Symbol.iterator]=="function",f=y&&Object.getPrototypeOf(""[Symbol.iterator]()),m=8,x=-1;function A(g){var D=typeof g;if(D!=="object")return D;if(g===null)return"null";if(g===t)return"global";if(Array.isArray(g)&&(n===!1||!(Symbol.toStringTag in g)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&g===window.location)return"Location";if(typeof window.document=="object"&&g===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&g===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&g===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&g instanceof window.HTMLElement){if(g.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(g.tagName==="TD")return"HTMLTableDataCellElement";if(g.tagName==="TH")return"HTMLTableHeaderCellElement"}}var W=n&&g[Symbol.toStringTag];if(typeof W=="string")return W;var v=Object.getPrototypeOf(g);return v===RegExp.prototype?"RegExp":v===Date.prototype?"Date":e&&v===Promise.prototype?"Promise":p&&v===Set.prototype?"Set":l&&v===Map.prototype?"Map":c&&v===WeakSet.prototype?"WeakSet":d&&v===WeakMap.prototype?"WeakMap":o&&v===DataView.prototype?"DataView":l&&v===S?"Map Iterator":p&&v===u?"Set Iterator":b&&v===j?"Array Iterator":y&&v===f?"String Iterator":v===null?"Object":Object.prototype.toString.call(g).slice(m,x)}return A}))});var me=q((Un,ct)=>{"use strict";ct.exports=Po;function V(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function Po(e){if(e=e||{},e.circles)return Do(e);let t=new Map;if(t.set(Date,c=>new Date(c)),t.set(Map,(c,o)=>new Map(l(Array.from(c),o))),t.set(Set,(c,o)=>new Set(l(Array.from(c),o))),e.constructorHandlers)for(let c of e.constructorHandlers)t.set(c[0],c[1]);let r=null;return e.proto?d:p;function l(c,o){let a=Object.keys(c),n=new Array(a.length);for(let i=0;i<a.length;i++){let s=a[i],u=c[s];typeof u!="object"||u===null?n[s]=u:u.constructor!==Object&&(r=t.get(u.constructor))?n[s]=r(u,o):ArrayBuffer.isView(u)?n[s]=V(u):n[s]=o(u)}return n}function p(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return l(c,p);if(c.constructor!==Object&&(r=t.get(c.constructor)))return r(c,p);let o={};for(let a in c){if(Object.hasOwnProperty.call(c,a)===!1)continue;let n=c[a];typeof n!="object"||n===null?o[a]=n:n.constructor!==Object&&(r=t.get(n.constructor))?o[a]=r(n,p):ArrayBuffer.isView(n)?o[a]=V(n):o[a]=p(n)}return o}function d(c){if(typeof c!="object"||c===null)return c;if(Array.isArray(c))return l(c,d);if(c.constructor!==Object&&(r=t.get(c.constructor)))return r(c,d);let o={};for(let a in c){let n=c[a];typeof n!="object"||n===null?o[a]=n:n.constructor!==Object&&(r=t.get(n.constructor))?o[a]=r(n,d):ArrayBuffer.isView(n)?o[a]=V(n):o[a]=d(n)}return o}}function Do(e){let t=[],r=[],l=new Map;if(l.set(Date,a=>new Date(a)),l.set(Map,(a,n)=>new Map(d(Array.from(a),n))),l.set(Set,(a,n)=>new Set(d(Array.from(a),n))),e.constructorHandlers)for(let a of e.constructorHandlers)l.set(a[0],a[1]);let p=null;return e.proto?o:c;function d(a,n){let i=Object.keys(a),s=new Array(i.length);for(let u=0;u<i.length;u++){let S=i[u],b=a[S];if(typeof b!="object"||b===null)s[S]=b;else if(b.constructor!==Object&&(p=l.get(b.constructor)))s[S]=p(b,n);else if(ArrayBuffer.isView(b))s[S]=V(b);else{let j=t.indexOf(b);j!==-1?s[S]=r[j]:s[S]=n(b)}}return s}function c(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return d(a,c);if(a.constructor!==Object&&(p=l.get(a.constructor)))return p(a,c);let n={};t.push(a),r.push(n);for(let i in a){if(Object.hasOwnProperty.call(a,i)===!1)continue;let s=a[i];if(typeof s!="object"||s===null)n[i]=s;else if(s.constructor!==Object&&(p=l.get(s.constructor)))n[i]=p(s,c);else if(ArrayBuffer.isView(s))n[i]=V(s);else{let u=t.indexOf(s);u!==-1?n[i]=r[u]:n[i]=c(s)}}return t.pop(),r.pop(),n}function o(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return d(a,o);if(a.constructor!==Object&&(p=l.get(a.constructor)))return p(a,o);let n={};t.push(a),r.push(n);for(let i in a){let s=a[i];if(typeof s!="object"||s===null)n[i]=s;else if(s.constructor!==Object&&(p=l.get(s.constructor)))n[i]=p(s,o);else if(ArrayBuffer.isView(s))n[i]=V(s);else{let u=t.indexOf(s);u!==-1?n[i]=r[u]:n[i]=o(s)}}return t.pop(),r.pop(),n}}});var bt=q((ht,te)=>{(function(e,t){"use strict";typeof te=="object"&&typeof te.exports=="object"?te.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(ht,function(){"use strict";var e=Object.prototype.toString;function t(i,s){return i==null?!1:Object.prototype.hasOwnProperty.call(i,s)}function r(i){if(!i||d(i)&&i.length===0)return!0;if(typeof i!="string"){for(var s in i)if(t(i,s))return!1;return!0}return!1}function l(i){return e.call(i)}function p(i){return typeof i=="object"&&l(i)==="[object Object]"}var d=Array.isArray||function(i){return e.call(i)==="[object Array]"};function c(i){return typeof i=="boolean"||l(i)==="[object Boolean]"}function o(i){var s=parseInt(i);return s.toString()===i?s:i}function a(i){i=i||{};var s=function(y){return Object.keys(s).reduce(function(f,m){return m==="create"||typeof s[m]=="function"&&(f[m]=s[m].bind(s,y)),f},{})},u;i.includeInheritedProps?u=function(){return!0}:u=function(y,f){return typeof f=="number"&&Array.isArray(y)||t(y,f)};function S(y,f){if(u(y,f))return y[f]}var b;i.includeInheritedProps?b=function(y,f){typeof f!="string"&&typeof f!="number"&&(f=String(f));var m=S(y,f);if(f==="__proto__"||f==="prototype"||f==="constructor"&&typeof m=="function")throw new Error("For security reasons, object's magic properties cannot be set");return m}:b=function(y,f){return S(y,f)};function j(y,f,m,x){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return y;if(typeof f=="string")return j(y,f.split(".").map(o),m,x);var A=f[0],g=b(y,A);return f.length===1?((g===void 0||!x)&&(y[A]=m),g):(g===void 0&&(typeof f[1]=="number"?y[A]=[]:y[A]={}),j(y[A],f.slice(1),m,x))}return s.has=function(y,f){if(typeof f=="number"?f=[f]:typeof f=="string"&&(f=f.split(".")),!f||f.length===0)return!!y;for(var m=0;m<f.length;m++){var x=o(f[m]);if(typeof x=="number"&&d(y)&&x<y.length||(i.includeInheritedProps?x in Object(y):t(y,x)))y=y[x];else return!1}return!0},s.ensureExists=function(y,f,m){return j(y,f,m,!0)},s.set=function(y,f,m,x){return j(y,f,m,x)},s.insert=function(y,f,m,x){var A=s.get(y,f);x=~~x,d(A)||(A=[],s.set(y,f,A)),A.splice(x,0,m)},s.empty=function(y,f){if(!r(f)&&y!=null){var m,x;if(m=s.get(y,f)){if(typeof m=="string")return s.set(y,f,"");if(c(m))return s.set(y,f,!1);if(typeof m=="number")return s.set(y,f,0);if(d(m))m.length=0;else if(p(m))for(x in m)u(m,x)&&delete m[x];else return s.set(y,f,null)}}},s.push=function(y,f){var m=s.get(y,f);d(m)||(m=[],s.set(y,f,m)),m.push.apply(m,Array.prototype.slice.call(arguments,2))},s.coalesce=function(y,f,m){for(var x,A=0,g=f.length;A<g;A++)if((x=s.get(y,f[A]))!==void 0)return x;return m},s.get=function(y,f,m){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return y;if(y==null)return m;if(typeof f=="string")return s.get(y,f.split("."),m);var x=o(f[0]),A=b(y,x);return A===void 0?m:f.length===1?A:s.get(y[x],f.slice(1),m)},s.del=function(f,m){if(typeof m=="number"&&(m=[m]),f==null||r(m))return f;if(typeof m=="string")return s.del(f,m.split("."));var x=o(m[0]);if(b(f,x),!u(f,x))return f;if(m.length===1)d(f)?f.splice(x,1):delete f[x];else return s.del(f[x],m.slice(1));return f},s}var n=a();return n.create=a,n.withInheritedProps=a({includeInheritedProps:!0}),n})});var At=q((he,be)=>{(function(e,t){typeof he=="object"&&typeof be<"u"?be.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=t())})(he,(function(){"use strict";var e=typeof Promise=="function",t=(function(g){if(typeof globalThis=="object")return globalThis;Object.defineProperty(g,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var D=typeDetectGlobalObject;return delete g.typeDetectGlobalObject,D})(Object.prototype),r=typeof Symbol<"u",l=typeof Map<"u",p=typeof Set<"u",d=typeof WeakMap<"u",c=typeof WeakSet<"u",o=typeof DataView<"u",a=r&&typeof Symbol.iterator<"u",n=r&&typeof Symbol.toStringTag<"u",i=p&&typeof Set.prototype.entries=="function",s=l&&typeof Map.prototype.entries=="function",u=i&&Object.getPrototypeOf(new Set().entries()),S=s&&Object.getPrototypeOf(new Map().entries()),b=a&&typeof Array.prototype[Symbol.iterator]=="function",j=b&&Object.getPrototypeOf([][Symbol.iterator]()),y=a&&typeof String.prototype[Symbol.iterator]=="function",f=y&&Object.getPrototypeOf(""[Symbol.iterator]()),m=8,x=-1;function A(g){var D=typeof g;if(D!=="object")return D;if(g===null)return"null";if(g===t)return"global";if(Array.isArray(g)&&(n===!1||!(Symbol.toStringTag in g)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&g===window.location)return"Location";if(typeof window.document=="object"&&g===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&g===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&g===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&g instanceof window.HTMLElement){if(g.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(g.tagName==="TD")return"HTMLTableDataCellElement";if(g.tagName==="TH")return"HTMLTableHeaderCellElement"}}var W=n&&g[Symbol.toStringTag];if(typeof W=="string")return W;var v=Object.getPrototypeOf(g);return v===RegExp.prototype?"RegExp":v===Date.prototype?"Date":e&&v===Promise.prototype?"Promise":p&&v===Set.prototype?"Set":l&&v===Map.prototype?"Map":c&&v===WeakSet.prototype?"WeakSet":d&&v===WeakMap.prototype?"WeakMap":o&&v===DataView.prototype?"DataView":l&&v===S?"Map Iterator":p&&v===u?"Set Iterator":b&&v===j?"Array Iterator":y&&v===f?"String Iterator":v===null?"Object":Object.prototype.toString.call(g).slice(m,x)}return A}))});var Uo={};Nt(Uo,{arrayFirstOnly:()=>Go,del:()=>Ko,drop:()=>Jo,find:()=>Vo,get:()=>Fo,set:()=>Ho,traverse:()=>N,version:()=>Co});var Mt=typeof global=="object"&&global&&global.Object===Object&&global,Q=Mt;var Lt=typeof self=="object"&&self&&self.Object===Object&&self,_t=Q||Lt||Function("return this")(),X=_t;var Bt=X.Symbol,C=Bt;var Te=Object.prototype,Rt=Te.hasOwnProperty,Ct=Te.toString,J=C?C.toStringTag:void 0;function Vt(e){var t=Rt.call(e,J),r=e[J];try{e[J]=void 0;var l=!0}catch(d){}var p=Ct.call(e);return l&&(t?e[J]=r:delete e[J]),p}var je=Vt;var Ft=Object.prototype,Ht=Ft.toString;function Jt(e){return Ht.call(e)}var $e=Jt;var Kt="[object Null]",Gt="[object Undefined]",ke=C?C.toStringTag:void 0;function Ut(e){return e==null?e===void 0?Gt:Kt:ke&&ke in Object(e)?je(e):$e(e)}var I=Ut;function qt(e){return e!=null&&typeof e=="object"}var P=qt;var zt="[object Symbol]";function Qt(e){return typeof e=="symbol"||P(e)&&I(e)==zt}var Ee=Qt;function Xt(e,t){for(var r=-1,l=e==null?0:e.length,p=Array(l);++r<l;)p[r]=t(e[r],r,e);return p}var Ie=Xt;var Zt=Array.isArray,Z=Zt;var Yt=/\s/;function er(e){for(var t=e.length;t--&&Yt.test(e.charAt(t)););return t}var Pe=er;var tr=/^\s+/;function rr(e){return e&&e.slice(0,Pe(e)+1).replace(tr,"")}var De=rr;function or(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var K=or;var Ne=NaN,ar=/^[-+]0x[0-9a-f]+$/i,nr=/^0b[01]+$/i,sr=/^0o[0-7]+$/i,ir=parseInt;function fr(e){if(typeof e=="number")return e;if(Ee(e))return Ne;if(K(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=K(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=De(e);var r=nr.test(e);return r||sr.test(e)?ir(e.slice(2),r?2:8):ar.test(e)?Ne:+e}var We=fr;var Me=1/0,lr=17976931348623157e292;function ur(e){if(!e)return e===0?e:0;if(e=We(e),e===Me||e===-Me){var t=e<0?-1:1;return t*lr}return e===e?e:0}var Le=ur;function pr(e){var t=Le(e),r=t%1;return t===t?r?t-r:t:0}var _e=pr;var mr="[object AsyncFunction]",cr="[object Function]",dr="[object GeneratorFunction]",yr="[object Proxy]";function gr(e){if(!K(e))return!1;var t=I(e);return t==cr||t==dr||t==mr||t==yr}var Be=gr;function xr(e,t,r,l){for(var p=e.length,d=r+(l?1:-1);l?d--:++d<p;)if(t(e[d],d,e))return d;return-1}var Re=xr;function hr(e){return e!==e}var Ce=hr;function br(e,t,r){for(var l=r-1,p=e.length;++l<p;)if(e[l]===t)return l;return-1}var Ve=br;function vr(e,t,r){return t===t?Ve(e,t,r):Re(e,Ce,r)}var Fe=vr;var wr=9007199254740991,Or=/^(?:0|[1-9]\d*)$/;function Sr(e,t){var r=typeof e;return t=t==null?wr:t,!!t&&(r=="number"||r!="symbol"&&Or.test(e))&&e>-1&&e%1==0&&e<t}var He=Sr;var Ar=9007199254740991;function Tr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ar}var Y=Tr;function jr(e){return e!=null&&Y(e.length)&&!Be(e)}var ee=jr;var $r=Object.prototype;function kr(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||$r;return e===r}var Je=kr;function Er(e,t){for(var r=-1,l=Array(e);++r<e;)l[r]=t(r);return l}var Ke=Er;var Ir="[object Arguments]";function Pr(e){return P(e)&&I(e)==Ir}var se=Pr;var Ge=Object.prototype,Dr=Ge.hasOwnProperty,Nr=Ge.propertyIsEnumerable,Wr=se((function(){return arguments})())?se:function(e){return P(e)&&Dr.call(e,"callee")&&!Nr.call(e,"callee")},Ue=Wr;function Mr(){return!1}var qe=Mr;var Xe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ze=Xe&&typeof module=="object"&&module&&!module.nodeType&&module,Lr=ze&&ze.exports===Xe,Qe=Lr?X.Buffer:void 0,_r=Qe?Qe.isBuffer:void 0,Br=_r||qe,Ze=Br;var Rr="[object Arguments]",Cr="[object Array]",Vr="[object Boolean]",Fr="[object Date]",Hr="[object Error]",Jr="[object Function]",Kr="[object Map]",Gr="[object Number]",Ur="[object Object]",qr="[object RegExp]",zr="[object Set]",Qr="[object String]",Xr="[object WeakMap]",Zr="[object ArrayBuffer]",Yr="[object DataView]",eo="[object Float32Array]",to="[object Float64Array]",ro="[object Int8Array]",oo="[object Int16Array]",ao="[object Int32Array]",no="[object Uint8Array]",so="[object Uint8ClampedArray]",io="[object Uint16Array]",fo="[object Uint32Array]",O={};O[eo]=O[to]=O[ro]=O[oo]=O[ao]=O[no]=O[so]=O[io]=O[fo]=!0;O[Rr]=O[Cr]=O[Zr]=O[Vr]=O[Yr]=O[Fr]=O[Hr]=O[Jr]=O[Kr]=O[Gr]=O[Ur]=O[qr]=O[zr]=O[Qr]=O[Xr]=!1;function lo(e){return P(e)&&Y(e.length)&&!!O[I(e)]}var Ye=lo;function uo(e){return function(t){return e(t)}}var et=uo;var tt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,G=tt&&typeof module=="object"&&module&&!module.nodeType&&module,po=G&&G.exports===tt,ie=po&&Q.process,mo=(function(){try{var e=G&&G.require&&G.require("util").types;return e||ie&&ie.binding&&ie.binding("util")}catch(t){}})(),fe=mo;var rt=fe&&fe.isTypedArray,co=rt?et(rt):Ye,ot=co;var yo=Object.prototype,go=yo.hasOwnProperty;function xo(e,t){var r=Z(e),l=!r&&Ue(e),p=!r&&!l&&Ze(e),d=!r&&!l&&!p&&ot(e),c=r||l||p||d,o=c?Ke(e.length,String):[],a=o.length;for(var n in e)(t||go.call(e,n))&&!(c&&(n=="length"||p&&(n=="offset"||n=="parent")||d&&(n=="buffer"||n=="byteLength"||n=="byteOffset")||He(n,a)))&&o.push(n);return o}var at=xo;function ho(e,t){return function(r){return e(t(r))}}var nt=ho;var bo=nt(Object.keys,Object),st=bo;var vo=Object.prototype,wo=vo.hasOwnProperty;function Oo(e){if(!Je(e))return st(e);var t=[];for(var r in Object(e))wo.call(e,r)&&r!="constructor"&&t.push(r);return t}var it=Oo;function So(e){return ee(e)?at(e):it(e)}var ft=So;var Ao="[object String]";function To(e){return typeof e=="string"||!Z(e)&&P(e)&&I(e)==Ao}var lt=To;function jo(e,t){return Ie(t,function(r){return e[r]})}var ut=jo;function $o(e){return e==null?[]:ut(e,ft(e))}var pt=$o;var ko=Math.max;function Eo(e,t,r,l){e=ee(e)?e:pt(e),r=r&&!l?_e(r):0;var p=e.length;return r<0&&(r=ko(p+r,0)),lt(e)?r<=p&&e.indexOf(t,r)>-1:!!p&&Fe(e,t,r)>-1}var U=Eo;var Io={msg:"",optsVarName:"given variable"};function le(e,t){var c;let r=["object","objects","obj","ob","o"],l=["array","arrays","arr","aray","arr","a"],p=["any","all","everything","both","either","each","whatever","whatevs","e"],d=h(h({},Io),t);if((c=d==null?void 0:d.msg)!=null&&c.length&&(d.msg="".concat(d.msg.trim()," ")),d.optsVarName!=="given variable"&&(d.optsVarName='variable "'.concat(d.optsVarName,'"')),U(r,e.toLowerCase().trim()))return"object";if(U(l,e.toLowerCase().trim()))return"array";if(U(p,e.toLowerCase().trim()))return"any";throw new TypeError("".concat(d.msg,"The ").concat(d.optsVarName," was customised to an unrecognised value: ").concat(e,". Please check it against the API documentation."))}var T=H(mt(),1);var xt=H(me(),1);var dt=H(me(),1);var qn=(0,dt.default)();function w(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 M(e){return typeof e=="string"}function L(e=[],t=[]){return!e||!Array.isArray(e)||!e.length?[]:!t||!Array.isArray(t)||!t.length?e:e.filter(r=>!t.includes(r))}function yt(e,t){return w(e)&&M(t)&&t in e}function gt(e=[],t=[]){return!e||!t?[]:Array.from(new Set(Array.from(e).filter(r=>new Set(t).has(r))))}function ce(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 de=(0,xt.default)();function N(e,t){let r={now:!1};function l(p,d,c,o){let a=de(p),n,i=h({depth:-1,path:""},c);if(i.depth+=1,Array.isArray(a))for(let s=0,u=a.length;s<u&&!o.now;s++){let S=i.path?"".concat(i.path,".").concat(s):"".concat(s);a[s]!==void 0?(i.parent=de(a),i.parentType="array",i.parentKey=ce(S),n=l(d(a[s],void 0,E(h({},i),{path:S}),o),d,E(h({},i),{path:S}),o),Number.isNaN(n)&&s<a.length?(a.splice(s,1),s-=1):a[s]=n):a.splice(s,1)}else if(w(a))for(let s in a){if(o.now&&s!=null)break;let u=i.path?"".concat(i.path,".").concat(s):s;i.depth===0&&s!=null&&(i.topmostKey=s),i.parent=de(a),i.parentType="object",i.parentKey=ce(u),n=l(d(s,a[s],E(h({},i),{path:u}),o),d,E(h({},i),{path:u}),o),Number.isNaN(n)?delete a[s]:a[s]=n}return a}return l(e,t,{},r)}function ye(e){return typeof e!="string"?e:e.length?[e]:[]}var re=H(bt(),1);function ge(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var xe=new Map,vt=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(r=>{if(typeof r!="string"){if(r===void 0)return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof r,"' in the array"))}return!0})},wt,Ot,St,No=(e,t)=>{t=h({caseSensitive:!1},t);let r="s"+(t.caseSensitive?"":"i"),l=e+"|"+r;if(xe.has(l))return xe.get(l);let p=e[0]==="!";p&&(e=e.slice(1)),e=e.replaceAll(String.raw(wt||(wt=z(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=ge(e).replaceAll(String.raw(Ot||(Ot=z(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(St||(St=z(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let d=new RegExp("^".concat(e,"$"),r);return d.negated=p,xe.set(l,d),d},Wo=(e,t,r,l)=>{if(e=vt(e,"inputs"),t=vt(t,"patterns"),t.length===0)return[];t=t.map(a=>No(a,r));let p=t.filter(a=>a.negated),d=t.filter(a=>!a.negated),{allPatterns:c}=r||{},o=[];if(c&&l&&p.length>1&&d.length===0){for(let a of e)for(let n of p)if(n.test(a))return[];return e.slice(0,1)}for(let a of e){let n=!1;for(let i of p)if(i.test(a)){n=!0;break}if(!n){if(d.length===0)o.push(a);else if(c){let i=Array.from({length:d.length},()=>!1);for(let[s,u]of d.entries())u.test(a)&&(i[s]=!0);i.every(Boolean)&&o.push(a)}else{let i=!1;for(let s of d)if(s.test(a)){i=!0;break}i&&o.push(a)}if(l&&o.length>0)break}}return o};function _(e,t,r){return Wo(e,t,r,!0).length>0}var Mo={ignoreKeys:[],ignorePaths:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"};function Lo(e,t,r){function l(n){return n!=null}function p(n,i){return typeof i=="string"&&(i=ye(i)),Array.from(n).filter(s=>!i.some(u=>_(s,u,{caseSensitive:!0})))}let d=Object.prototype.hasOwnProperty,c=["any","anything","every","everything","all","whatever","whatevs"];if(!l(e))throw new Error("check-types-mini: [THROW_ID_01] First argument is missing!");let o=h(h({},Mo),r);if(typeof o.ignoreKeys=="string"&&(o.ignoreKeys=[o.ignoreKeys]),typeof o.ignorePaths=="string"&&(o.ignorePaths=[o.ignorePaths]),typeof o.acceptArraysIgnore=="string"&&(o.acceptArraysIgnore=[o.acceptArraysIgnore]),o.msg="".concat(o.msg).trim(),o.msg[o.msg.length-1]===":"&&(o.msg=o.msg.slice(0,o.msg.length-1).trim()),w(o.schema))Object.keys(o.schema).forEach(n=>{if(w(o.schema[n])){let i={};N(o.schema[n],(s,u,S)=>{let b=u!==void 0?u:s;return!Array.isArray(b)&&!w(b)&&(i["".concat(n,".").concat(S.path)]=b),b}),delete o.schema[n],o.schema=h(h({},o.schema),i)}}),Object.keys(o.schema).forEach(n=>{Array.isArray(o.schema[n])||(o.schema[n]=[o.schema[n]]),o.schema[n]=o.schema[n].map(i=>"".concat(i).toLowerCase().trim())});else if(o.schema!=null)throw new Error("check-types-mini: opts.schema was customised to ".concat(JSON.stringify(o.schema,null,0)," which is not object but ").concat(typeof o.schema));if(l(t)||(t={}),o.enforceStrictKeyset)if(l(o.schema)&&Object.keys(o.schema).length){if(t&&p(L(Object.keys(e),Object.keys(t).concat(Object.keys(o.schema))),o.ignoreKeys).length){let n=L(Object.keys(e),Object.keys(t).concat(Object.keys(o.schema)));throw new TypeError("".concat(o.msg,": ").concat(o.optsVarName,".enforceStrictKeyset is on and the following key").concat(n.length>1?"s":""," ").concat(n.length>1?"are":"is"," not covered by schema and/or reference objects: ").concat(n.join(", ")))}}else if(w(t)&&Object.keys(t).length){if(p(L(Object.keys(e),Object.keys(t)),o.ignoreKeys).length!==0){let n=L(Object.keys(e),Object.keys(t));throw new TypeError("".concat(o.msg,": The input object has key").concat(n.length>1?"s":""," which ").concat(n.length>1?"are":"is"," not covered by the reference object: ").concat(n.join(", ")))}else if(p(L(Object.keys(t),Object.keys(e)),o.ignoreKeys).length!==0){let n=L(Object.keys(t),Object.keys(e));throw new TypeError("".concat(o.msg,": The reference object has key").concat(n.length>1?"s":""," which ").concat(n.length>1?"are":"is"," not present in the input object: ").concat(n.join(", ")))}}else throw new TypeError("".concat(o.msg,": Both ").concat(o.optsVarName,".schema and reference objects are missing! We don't have anything to match the keys as you requested via resolvedOpts.enforceStrictKeyset!"));let a=[];N(e,(n,i,s)=>{let u=i,S=n;if(s.parentType==="array"&&(S=void 0,u=n),Array.isArray(a)&&a.length&&a.some(f=>s.path.startsWith(f))||S&&o.ignoreKeys.some(f=>S&&_(S,f))||o.ignorePaths.some(f=>_(s.path,f)))return u;let b=!(!w(u)&&!Array.isArray(u)&&Array.isArray(s.parent)),j=!1;w(o.schema)&&d.call(o.schema,s.path)&&(j=!0);let y=!1;if(w(t)&&re.default.has(t,s.path)&&(y=!0),o.enforceStrictKeyset&&b&&!j&&!y)throw new TypeError("".concat(o.msg,": ").concat(o.optsVarName,".").concat(s.path," is neither covered by reference object (second input argument), nor ").concat(o.optsVarName,".schema! To stop this error, turn off ").concat(o.optsVarName,".enforceStrictKeyset or provide some type reference (2nd argument or ").concat(o.optsVarName,".schema).\n\nDebug info:\n\nobj = ").concat(JSON.stringify(e,null,4),"\n\nref = ").concat(JSON.stringify(t,null,4),"\n\ninnerObj = ").concat(JSON.stringify(s,null,4),"\n\nresolvedOpts = ").concat(JSON.stringify(o,null,4),"\n\ncurrent = ").concat(JSON.stringify(u,null,4),"\n\n"));if(j){let f=ye(o.schema[s.path]).map(m=>"".concat(m).toLowerCase());if(re.default.set(o.schema,s.path,f),gt(f,c).length)a.push(s.path);else if(u!==!0&&u!==!1&&!f.includes((0,T.default)(u).toLowerCase())||(u===!0||u===!1)&&!f.includes(String(u))&&!f.includes("boolean"))if(Array.isArray(u)&&o.acceptArrays){for(let m=0,x=u.length;m<x;m++)if(!f.includes((0,T.default)(u[m]).toLowerCase()))throw new TypeError("".concat(o.msg,": ").concat(o.optsVarName,".").concat(s.path,".").concat(m,", the ").concat(m,"th element (equal to ").concat(JSON.stringify(u[m],null,0),") is of a type ").concat((0,T.default)(u[m]).toLowerCase(),", but only the following are allowed by the ").concat(o.optsVarName,".schema: ").concat(f.join(", ")))}else throw new TypeError("".concat(o.msg,": ").concat(o.optsVarName,".").concat(s.path," was customised to ").concat((0,T.default)(u)!=="string"?'"':"").concat(JSON.stringify(u,null,0)).concat((0,T.default)(u)!=="string"?'"':""," (type: ").concat((0,T.default)(u).toLowerCase(),") which is not among the allowed types in schema (which is equal to ").concat(JSON.stringify(f,null,0),")"))}else if(t&&w(t)&&y){let f=re.default.get(t,s.path);if(o.acceptArrays&&Array.isArray(u)&&!o.acceptArraysIgnore.includes(n)){if(!u.every(m=>(0,T.default)(m).toLowerCase()===(0,T.default)(t[n]).toLowerCase()))throw new TypeError("".concat(o.msg,": ").concat(o.optsVarName,".").concat(s.path," was customised to be array, but not all of its elements are ").concat((0,T.default)(t[n]).toLowerCase(),"-type"))}else if((0,T.default)(u)!==(0,T.default)(f))throw new TypeError("".concat(o.msg,": ").concat(o.optsVarName,".").concat(s.path," was customised to ").concat((0,T.default)(u).toLowerCase()==="string"?"":'"').concat(JSON.stringify(u,null,0)).concat((0,T.default)(u).toLowerCase()==="string"?"":'"'," which is not ").concat((0,T.default)(f).toLowerCase()," but ").concat((0,T.default)(u).toLowerCase()))}return u})}function oe(e,t,r){Lo(e,t,r)}var B=H(At(),1);function k(e){if(typeof e=="string")return!e.trim();if(!["object","string"].includes(typeof e)||!e)return!1;let t=!0;return e=N(e,(r,l,p,d)=>{let c=l!==void 0?l:r;return typeof c=="string"&&c.trim()&&(t=!1,d.now=!0),c}),t}function _o(e){return w(e)?!Object.keys(e).length:Array.isArray(e)||typeof e=="string"?!e.length:!1}var Bo={hungryForWhitespace:!1,matchStrictly:!1,verboseWhenMismatches:!1,useWildcards:!1};function ae(e,t,r){let l,p,d,c=0,o=h(h({},Bo),r);if(o.hungryForWhitespace&&o.matchStrictly&&w(e)&&k(e)&&w(t)&&!Object.keys(t).length)return!0;if((!o.hungryForWhitespace||o.hungryForWhitespace&&!k(e)&&k(t))&&w(e)&&Object.keys(e).length!==0&&w(t)&&Object.keys(t).length===0||(0,B.default)(e)!==(0,B.default)(t)&&(!o.hungryForWhitespace||o.hungryForWhitespace&&!k(e)))return!1;if(typeof e=="string"&&typeof t=="string")return o.hungryForWhitespace&&k(e)&&k(t)?!0:o.verboseWhenMismatches?e===t?!0:"Given string ".concat(t," is not matched! We have ").concat(e," on the other end."):o.useWildcards?_(e,t,{caseSensitive:!0}):e===t;if(Array.isArray(e)&&Array.isArray(t)){if(o.hungryForWhitespace&&k(t)&&(!o.matchStrictly||o.matchStrictly&&e.length===t.length))return!0;if(!o.hungryForWhitespace&&t.length>e.length||o.matchStrictly&&t.length!==e.length)return o.verboseWhenMismatches?"The length of a given array, ".concat(JSON.stringify(t,null,4)," is ").concat(t.length," but the length of an array on the other end, ").concat(JSON.stringify(e,null,4)," is ").concat(e.length):!1;if(t.length===0)return e.length===0?!0:o.verboseWhenMismatches?"The given array has no elements, but the array on the other end, ".concat(JSON.stringify(e,null,4)," does have some"):!1;for(let a=0,n=t.length;a<n;a++){d=!1;for(let i=c,s=e.length;i<s;i++)if(c+=1,ae(e[i],t[a],o)===!0){d=!0;break}if(!d)return o.verboseWhenMismatches?"The given array ".concat(JSON.stringify(t,null,4)," is not a subset of an array on the other end, ").concat(JSON.stringify(e,null,4)):!1}}else if(w(e)&&w(t)){if(l=new Set(Object.keys(t)),p=new Set(Object.keys(e)),o.matchStrictly&&l.size!==p.size){if(!o.verboseWhenMismatches)return!1;let a=new Set([...l].filter(u=>!p.has(u))),n=a.size?" First object has unique keys: ".concat(JSON.stringify(a,null,4),"."):"",i=new Set([...p].filter(u=>!l.has(u))),s=i.size?" Second object has unique keys:\n ".concat(JSON.stringify(i,null,4),"."):"";return"When matching strictly, we found that both objects have different amount of keys.".concat(n).concat(s)}for(let a of l){if(!yt(e,a))return!o.useWildcards||o.useWildcards&&!a.includes("*")?o.verboseWhenMismatches?'The given object has key "'.concat(a,'" which the other-one does not have.'):!1:Object.keys(e).some(n=>_(n,a,{caseSensitive:!0}))?!0:o.verboseWhenMismatches?'The given object has key "'.concat(a,'" which the other-one does not have.'):!1;if(e[a]!=null&&(0,B.default)(e[a])!==(0,B.default)(t[a])){if(!(k(e[a])&&k(t[a])&&o.hungryForWhitespace))return o.verboseWhenMismatches?"The given key ".concat(a," is of a different type on both objects. On the first-one, it's ").concat((0,B.default)(t[a]),", on the second-one, it's ").concat((0,B.default)(e[a])):!1}else if(ae(e[a],t[a],o)!==!0)return o.verboseWhenMismatches?"The given piece ".concat(JSON.stringify(t[a],null,4)," and ").concat(JSON.stringify(e[a],null,4)," don't match."):!1}}else return o.hungryForWhitespace&&k(e)&&k(t)&&(!o.matchStrictly||o.matchStrictly&&_o(t))?!0:e===t;return!0}var Tt="9.1.3";var Co=Tt;function $(e){return e!=null}function ne(e,t){return typeof e!=typeof t?!1:!!ae(e,t,{matchStrictly:!0,useWildcards:!0})}function F(e,t){let r=h({},t),l={count:0,gatherPath:[],finding:null},p=[],d=!1,c=!1;$(r.key)&&r.val===void 0&&(d=!0),!$(r.key)&&r.val!==void 0&&(c=!0);let o=e;return r.mode==="arrayFirstOnly"&&Array.isArray(o)&&o.length&&(o=[o[0]]),o=N(o,(a,n,i)=>{let s;if(l.count+=1,l.gatherPath.length=i.depth,l.gatherPath.push(l.count),r.mode==="get")l.count===r.index&&(i.parentType==="object"?(l.finding={},l.finding[a]=n):l.finding=a);else if(r.mode==="find"||r.mode==="del")if((r.only==="any"||r.only==="array"&&i.parentType==="array"||r.only==="object"&&i.parentType!=="array")&&(d&&ne(a,r.key)||c&&ne(n,r.val)||!d&&!c&&ne(a,r.key)&&ne(n,r.val)))if(r.mode==="find")s={index:l.count,key:a,val:n,path:[...l.gatherPath]},p.push(s);else return NaN;else return i.parentType==="object"?n:a;return r.mode==="set"&&l.count===r.index?r.val:r.mode==="drop"&&l.count===r.index?NaN:r.mode==="arrayFirstOnly"?i.parentType==="object"&&Array.isArray(n)?[n[0]]:$(a)&&Array.isArray(a)?[a[0]]:i.parentType==="object"?n:a:i.parentType==="object"?n:a}),r.mode==="get"?l.finding:r.mode==="find"?p:o}function Vo(e,t){if(!$(e))throw new Error("ast-monkey/main.js/find(): [THROW_ID_02] Please provide the input");if(!w(t)||t.key===void 0&&t.val===void 0)throw new Error("ast-monkey/main.js/find(): [THROW_ID_03] Please provide resolvedOpts.key or resolvedOpts.val");let r=h({},t);return oe(r,null,{schema:{key:["null","string"],val:"any",only:["undefined","null","string"]},msg:"ast-monkey/get(): [THROW_ID_04*]"}),M(r.only)&&r.only.length?r.only=le(r.only,{optsVarName:"resolvedOpts.only",msg:"ast-monkey/find(): [THROW_ID_05*]"}):r.only="any",F(e,E(h({},r),{mode:"find"}))}function Fo(e,t){if(!$(e))throw new Error("ast-monkey/main.js/get(): [THROW_ID_06] Please provide the input");if(!w(t))throw new Error("ast-monkey/main.js/get(): [THROW_ID_07] Please provide the resolvedOpts");if(!$(t.index))throw new Error("ast-monkey/main.js/get(): [THROW_ID_08] Please provide resolvedOpts.index");let r=h({},t);if(M(r.index)&&/^\d+$/.test(r.index))r.index=+r.index;else if(!Number.isInteger(r.index))throw new Error("ast-monkey/main.js/get(): [THROW_ID_11] resolvedOpts.index must be a natural number. It was given as: ".concat(r.index," (type ").concat(typeof r.index,")"));return F(e,E(h({},r),{mode:"get"}))}function Ho(e,t){if(!$(e))throw new Error("ast-monkey/main.js/set(): [THROW_ID_12] Please provide the input");if(!w(t))throw new Error("ast-monkey/main.js/set(): [THROW_ID_13] Please provide the input");if(!$(t.key)&&t.val===void 0)throw new Error("ast-monkey/main.js/set(): [THROW_ID_14] Please provide resolvedOpts.val");if(!$(t.index))throw new Error("ast-monkey/main.js/set(): [THROW_ID_15] Please provide resolvedOpts.index");let r=h({},t);if(M(r.index)&&/^\d+$/.test(r.index))r.index=+r.index;else if(!Number.isInteger(r.index))throw new Error("ast-monkey/main.js/set(): [THROW_ID_17] resolvedOpts.index must be a natural number. It was given as: ".concat(r.index));return $(r.key)&&r.val===void 0&&(r.val=r.key),oe(r,null,{schema:{key:[null,"string"],val:"any",index:"number"},msg:"ast-monkey/set(): [THROW_ID_18*]"}),F(e,E(h({},r),{mode:"set"}))}function Jo(e,t){if(!$(e))throw new Error("ast-monkey/main.js/drop(): [THROW_ID_19] Please provide the input");if(!w(t))throw new Error("ast-monkey/main.js/drop(): [THROW_ID_20] Please provide the input");if(!$(t.index))throw new Error("ast-monkey/main.js/drop(): [THROW_ID_21] Please provide resolvedOpts.index");let r=h({},t);if(M(r.index)&&/^\d+$/.test(r.index))r.index=+r.index;else if(!Number.isInteger(r.index))throw new Error("ast-monkey/main.js/drop(): [THROW_ID_23] resolvedOpts.index must be a natural number. It was given as: ".concat(r.index));return F(e,E(h({},r),{mode:"drop"}))}function Ko(e,t){if(!$(e))throw new Error("ast-monkey/main.js/del(): [THROW_ID_26] Please provide the input");if(!w(t))throw new Error("ast-monkey/main.js/del(): [THROW_ID_27] Please provide the resolvedOpts object");if(!$(t.key)&&t.val===void 0)throw new Error("ast-monkey/main.js/del(): [THROW_ID_28] Please provide resolvedOpts.key or resolvedOpts.val");let r=h({},t);return oe(r,null,{schema:{key:[null,"string"],val:"any",only:["undefined","null","string"]},msg:"ast-monkey/drop(): [THROW_ID_29*]"}),M(r.only)&&r.only.length?r.only=le(r.only,{msg:"ast-monkey/del(): [THROW_ID_30*]",optsVarName:"resolvedOpts.only"}):r.only="any",F(e,E(h({},r),{mode:"del"}))}function Go(e){if(!$(e))throw new Error("ast-monkey/main.js/arrayFirstOnly(): [THROW_ID_31] Please provide the input");return F(e,{mode:"arrayFirstOnly"})}return Wt(Uo);})();
/**
* @name util-array-object-or-both
* @fileoverview Validate and normalise user choice: array, object or both?
* @version 5.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/util-array-object-or-both/}
*/
/**
* @name codsen-utils
* @fileoverview Various utility functions
* @version 1.7.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/codsen-utils/}
*/
/**
* @name ast-monkey-util
* @fileoverview Utility library of AST helper functions
* @version 3.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/ast-monkey-util/}
*/
/**
* @name ast-monkey-traverse
* @fileoverview Utility library to traverse AST
* @version 4.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/ast-monkey-traverse/}
*/
/**
* @name arrayiffy-if-string
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* @version 5.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/arrayiffy-if-string/}
*/
/**
* @name check-types-mini
* @fileoverview Validate options object
* @version 8.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/check-types-mini/}
*/
/**
* @name ast-contains-only-empty-space
* @fileoverview Does AST contain only empty space?
* @version 4.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/ast-contains-only-empty-space/}
*/
/**
* @name ast-compare
* @fileoverview Compare anything: AST, objects, arrays, strings and nested thereof
* @version 4.1.3
* @author Roy Revelt
* @license MIT
* {@link https://codsen.com/os/ast-compare/}
*/
/*! Bundled license information:
lodash-es/lodash.js:
(**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./`
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*)
*/