array-map-x
Version:
Creates an array with the results of calling a function on every element.
15 lines • 16.9 kB
JavaScript
/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2017",
"date": "2019-08-28T17:21:57.603Z",
"describe": "",
"description": "Creates an array with the results of calling a function on every element.",
"file": "array-map-x.min.js",
"hash": "43b382bd3b8e0707b9a7",
"license": "MIT",
"version": "3.1.2"
}
*/
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.arrayMapX=n():t.arrayMapX=n()}(function(){"use strict";var t,n={}.constructor,e=n.prototype,r=n.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},u=function(){return this};try{return r?r(e,"$$globalThis$$",{get:u,configurable:!0}):e.__defineGetter__("$$globalThis$$",u),t="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete e.$$globalThis$$,t}catch(t){return o()}}(),function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=6)}([function(t,n,e){"use strict";var r=Object.prototype.toString;if(e(3)()){var o=Symbol.prototype.toString,u=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&u.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,n,e){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"string"==typeof t||"object"==typeof t&&(u?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object String]"===o.call(t))}},function(t,n,e){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(u?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},function(t,n,e){"use strict";(function(n){var r=n.Symbol,o=e(5);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,e(4))},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},n=Symbol("test"),e=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(n in t[n]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,n);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.r(n);var o=function(t){return"object"===r(t)?null===t:"function"!=typeof t},u=e(1),i=e.n(u),c={}.constructor("a"),s="a"===c[0]&&0 in c,f=function(){}.bind,a="function"==typeof f&&function(){var t=null,n=null,e=null,r=[];try{var o=f.apply(function(r,o){return e=this,t=r,n=o,arguments},[r,1]),u=o(2);return 1===o.length&&2===u.length&&1===t&&2===n&&e===r}catch(t){return!1}}()&&function(){var t=null,n=null,e=null,r=[1,2,3],o=function(o,u){return t=o,n=u,e=this,r};try{var u=f.apply(o,[null]),i=new u(1,2);return u.length===o.length&&i===r&&1===t&&2===n&&e!==r}catch(t){return!1}}(),l="".split,p=Math.max,y=o.bind,d=o.call,b=a?y.call(d,l):function(t,n){return l.call(t,n)},v=function(t){return i()(t)?b(t,""):t},g=function(t,n){var e=arguments.length>2?arguments[2]:[];if("string"!=typeof t&&o(t))return e;for(var r=s?t:v(t),u=r.length,i=p(0,n)||0;i<u;i+=1)e[e.length]=t[i];return e};function h(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=[],r=!0,o=!1,u=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(e.push(i.value),!n||e.length!==n);r=!0);}catch(t){o=!0,u=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw u}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var m=g.bind,w=g.call,S={},j=S.constructor,O=S.toString,T=function(t,n){return t>=n?t:n},x=function(t){if("function"!=typeof t&&"[object Function]"!==O.apply(t))throw new TypeError("bind called on incompatible "+t)},$=[function(t){return function(){return t.apply(this,g(arguments))}},function(t,n){return function(e){return t.apply(this,g(arguments,n,[e]))}},function(t,n){return function(e,r){return t.apply(this,g(arguments,n,[e,r]))}},function(t,n){return function(e,r,o){return t.apply(this,g(arguments,n,[e,r,o]))}},function(t,n){return function(e,r,o,u){return t.apply(this,g(arguments,n,[e,r,o,u]))}},function(t,n){return function(e,r,o,u,i){return t.apply(this,g(arguments,n,[e,r,o,u,i]))}},function(t,n){return function(e,r,o,u,i,c){return t.apply(this,g(arguments,n,[e,r,o,u,i,c]))}},function(t,n){return function(e,r,o,u,i,c,s){return t.apply(this,g(arguments,n,[e,r,o,u,i,c,s]))}},function(t,n){return function(e,r,o,u,i,c,s,f){return t.apply(this,g(arguments,n,[e,r,o,u,i,c,s,f]))}}],E=function(t){var n=h(t,3),e=n[0],r=n[1],o=n[2],u=T(0,r.length-T(0,o.length-2)),i=$[u],c=i?i(e,u):$[0](e);if(r.prototype){var s=function(){};s.prototype=r.prototype,c.prototype=new s,s.prototype=null}return c},P=function(t,n){var e=t.apply(this,n);return j(e)===e?e:this},M=a?w.bind(m):function(t,n){x(t);var e,r=arguments,o=function(){var o=g(arguments,0,g(r,2));return this instanceof e?P.apply(this,[t,o]):t.apply(n,o)};return e=E([o,t,r])},F=TypeError,_=M.apply,N=M(M.call,_),C=M(_,{}.toString),k=function(t){if("function"!=typeof t&&"[object Function]"!==C(t))throw new F(t+" is not a function");return t},D=function(t,n){return N(k(t),n,g(arguments[2]))},A=function(t){try{return{threw:!1,value:D(t,this,g(arguments,1))}}catch(t){return{threw:!0,value:t}}},I=function(t){return null==t},B=function(t){if(I(t))throw new TypeError("Cannot call method on ".concat(t));return t},X={}.constructor,q=function(t){return X(B(t))},G=function(t){return!!t},L={}.toString,z=function(t){return function(t){if("function"!=typeof t&&"[object Function]"!==D(L,t))throw new TypeError("methodize called on incompatible "+t)}(t),function(){return D(t,arguments[0],g(arguments,1))}},H=z({}.toString),R=function(t){return null===t?"[object Null]":void 0===t?"[object Undefined]":H(t)},U=e(0),V=e.n(U);for(var J=A(function(){return function(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&V()(Symbol(""))}.bind(void 0)),K=!1===J.threw&&!0===J.value,Q=K&&V()(Symbol.toStringTag),W="Cannot convert a Symbol value to a string".constructor,Y=function(t){if(V()(t))throw new TypeError("Cannot convert a Symbol value to a string");return W(t)},Z=function(t){return Y(B(t))},tt=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],nt="",et=tt.length,rt=0;rt<et;rt+=1)tt[rt].es2016&&tt[rt].string,tt[rt].es2018&&(nt+=tt[rt].string);var ot=nt,ut=new(0,/none/.constructor)("^[".concat(ot,"]+")),it=z("".replace),ct=function(t){return it(Z(t),ut,"")},st=new(0,/none/.constructor)("[".concat(ot,"]+$")),ft=z("".replace),at=function(t){return ft(Z(t),st,"")},lt=function(t){return ct(at(t))},pt=new(0,/none/.constructor)("[".concat(ot,"]+"),"g"),yt=z(" ".replace),dt=function(t){return yt(lt(t),pt," ")},bt=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,vt=z("".replace),gt=function(t,n){return vt(Z(t),bt,arguments.length>1?Y(n):"")},ht=A.constructor,mt=z(A.toString),wt=/^class /,St=z(wt.test),jt=!1===A(function(){return ht('"use strict"; return class My {};')()}).threw,Ot=function(t){return St(wt,dt(gt(mt(t)," ")))},Tt=function(t){var n=A(Ot,t);return!1===n.threw&&n.value},xt=function(t,n){return!o(t)&&(Q?function(t,n){return!(jt&&!1===n&&Tt(t)||!1!==A(function(){return mt(t)}).threw)}(t,G(n)):(!jt||!1!==G(n)||!Tt(t))&&function(t){var n=R(t);return"[object Function]"===n||"[object GeneratorFunction]"===n||"[object AsyncFunction]"===n}(t))},$t=K&&Symbol.prototype.toString,Et="function"==typeof $t&&V.a,Pt="".constructor,Mt=function(t){return Et&&Et(t)?$t.call(t):Pt(t)},Ft=function(t,n){if(!1===xt(t)){var e=arguments.length>1?Mt(n):"".concat(o(t)?Mt(t):"#<Object>"," is not a function");throw new TypeError(e)}return t},_t=e(2),Nt=e.n(_t),Ct="string".constructor,kt=(0).constructor,Dt=K&&Symbol.toPrimitive,At=K&&Symbol.prototype.valueOf,It=["toString","valueOf"],Bt=["valueOf","toString"],Xt=function(t,n){B(t),function(t){if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"')}(n);for(var e="string"===n?It:Bt,r=0;r<2;r+=1){var u=t[e[r]];if(xt(u)){var i=D(u,t);if(o(i))return i}}throw new TypeError("No default value")},qt=function(t,n){if(n){if(t===Ct)return"string";if(t===kt)return"number"}return"default"},Gt=function(t){if(K){if(Dt)return function(t,n){var e=t[n];if(!1===I(e)){if(!1===xt(e))throw new TypeError("".concat(e," returned for property ").concat(n," of object ").concat(t," is not a function"));return e}}(t,Dt);if(V()(t))return At}},Lt=function(t){var n=t.exoticToPrim,e=t.input,r=t.hint,u=D(n,e,[r]);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")},zt=function(t,n){var e="default"===n&&(Nt()(t)||V()(t))?"string":n;return Xt(t,"default"===e?"number":e)},Ht=function(t,n){if(o(t))return t;var e=qt(n,arguments.length>1),r=Gt(t);return void 0===r?zt(t,e):Lt({exoticToPrim:r,input:t,hint:e})},Rt=parseInt,Ut=(0).constructor,Vt=z("".charAt),Jt=/^[-+]?0[xX]/,Kt=z(Jt.test),Qt=function(t,n){var e=ct(Y(t));return""===Vt(e,0)?NaN:Rt(e,Ut(n)||(Kt(Jt,e)?16:10))},Wt=2..constructor,Yt=z("Cannot convert a Symbol value to a number".slice),Zt=/^0b[01]+$/i,tn=Zt.constructor,nn=z(Zt.test),en=/^0o[0-7]+$/i,rn=new tn("[
]","g"),on=/^[-+]0x[0-9a-f]+$/i,un=function(t,n){return Qt(Yt(t,2),n)},cn=function(t,n){return function(t){return nn(Zt,t)}(n)?t(un(n,2)):function(t){return nn(en,t)}(n)?t(un(n,8)):null},sn=function(t,n){var e=cn(t,n);if(null!==e)return e;if(function(t){return nn(rn,t)}(n)||function(t){return nn(on,t)}(n))return NaN;var r=lt(n);return r!==n?t(r):null},fn=function t(n){var e=function(t){if(V()(t))throw new TypeError("Cannot convert a Symbol value to a number");return t}(Ht(n,Wt));if("string"==typeof e){var r=sn(t,e);if(null!==r)return r}return Wt(e)},an=function(t){return t!=t},ln=function(t){return"number"==typeof t&&!1===an(t)&&t!==1/0&&t!==-1/0},pn=function(t){var n=fn(t);return 0===n||an(n)?n:n>0?1:-1},yn=Math.abs,dn=Math.floor,bn=function(t){var n=fn(t);return an(n)?0:0===n||!1===ln(n)?n:pn(n)*dn(yn(n))},vn=function(t){var n=bn(t);return n<=0?0:n>9007199254740991?9007199254740991:n},gn=z("".split),hn=function(t){return t},mn=s?hn:function(t){return i()(t)?gn(t,""):hn(t)},wn=function(t,n){var e=q(t);Ft(n);var r=mn(e),o=vn(r.length);if(o)for(var u=arguments[2],i=0;i<o;i+=1)if(D(n,u,[r[i],i,e]))return!0;return!1},Sn=function(t,n){wn(t,function(){D(n,this,arguments)},arguments[2])};e.d(n,"implementation",function(){return Mn});var jn,On=[].map,Tn="function"==typeof On&&z(On),xn=function(t){return t},$n="undefined"!=typeof document&&document,En=function(){return!1===G(this)}(),Pn=G(Tn)&&(!1===(jn=A(function(){return Tn([1,2],xn)})).threw&&jn.value&&2===jn.value.length&&1===jn.value[0]&&2===jn.value[1])&&function(){var t=A(function(){return Tn(q("ab"),xn)});return!1===t.threw&&t.value&&2===t.value.length&&"a"===t.value[0]&&"b"===t.value[1]}()&&function(){var t=A(function(){var t=function(){return arguments}(1,2);return Tn(t,xn)});return!1===t.threw&&t.value&&2===t.value.length&&1===t.value[0]&&2===t.value[1]}()&&function(){var t=A(function(){return Tn({0:1,2:2,length:3},xn)});return!1===t.threw&&t.value&&3===t.value.length&&!(1 in t.value)}()&&function(){if($n){var t=$n.createDocumentFragment(),n=$n.createElement("div");return t.appendChild(n),function(t,n){return!1===t.threw&&t.value&&1===t.value.length&&t.value[0]===n}(A(function(){return Tn(t.childNodes,xn)}),n)}return!0}()&&function(){if(En){var t=null,n=function(){t="string"==typeof this},e=A(function(){return Tn([1],n,"x")});return!1===e.threw&&e.value&&1===e.value.length&&!0===t}return!0}()&&function(){var t={},n=A(function(){return Function("nativeMap","spy","castBoolean",'return nativeMap("foo", function (_, __, context) {if (castBoolean(context) === false || typeof context !== "object") {spy.value = true;}});')(Tn,t,G)});return!1===n.threw&&n.value&&3===n.value.length&&!0!==t.value}(),Mn=function(t,n){var e=q(t);Ft(n);var r=[],o=function(){var t=arguments[1];t in arguments[2]&&(r[t]=D(n,this,[arguments[0],t,e]))};return Sn(e,o,arguments[2]),r},Fn=Pn?function(t,n){return Tn(B(t),Ft(n),arguments[2])}:Mn;n.default=Fn}])});
//# sourceMappingURL=array-map-x.min.js.map