UNPKG

@minionorg/share

Version:
2 lines (1 loc) 852 B
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.index={}))})(this,function(r){"use strict";function n(t){return t.charAt(0).toUpperCase()+t.slice(1)}function i(t){if(!t)throw new SyntaxError("type is must");return function(e){return Object.prototype.toString.call(e)===`[object ${n(t)}]`}}function u(t,e){if(!i("Array")(t))throw new TypeError("The list must be array");const o=[...t];if(o.length===0)return o;if(e===void 0)throw new SyntaxError("The index must be required");if(i("Number")(e))e<0?e=0:e>=o.length?e=o.length-1:e=Math.floor(e);else throw new TypeError("The index must be number");return o.splice(e,1),o}r.default=u,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});