args-to-arr
Version:
converts arguments or any other array-like object into an array starting from specific index.
3 lines (2 loc) • 1.07 kB
JavaScript
var e,n;e=this,n=function(){"use strict";var e=Array.isArray,n=Object.prototype.toString,r=e||function(e){return!!e&&"[object Array]"==n.call(e)},t=function(e){var n=o.call(e);return"[object Function]"===n||"function"==typeof e&&"[object RegExp]"!==n||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},o=Object.prototype.toString,i=function(e){if(!e)return!1;if(r(e))return!0;if(t(e)||function(e){if(null==e)return!1;var n=Object(e);return n===n.window}(e))return!1;var n="length"in(e=Object(e))&&e.length;return!(1!==e.nodeType||!n)||(0===n||"number"==typeof n&&n>0&&n-1 in e)};return function(e,n){if(!i(e))throw new TypeError(e+" can't be converted to array.");if(null==n&&(n=0),"number"!=typeof n)throw new TypeError(n+" is not a number.");for(var r=e.length,t=new Array(r-n),o=n;o<r;o++)t[o-n]=e[o];return t}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).toArray=n();
//# sourceMappingURL=args-to-arr.umd.min.js.map