UNPKG

array-utils-split

Version:

#### how to use ``` // or import const splitArray = require('array-utils-split');

2 lines (1 loc) 511 B
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).rem=n()}(this,function(){"use strict";return function(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:50,t=e.length,i=[];if(t<=n)return[e].filter(function(e){return e&&0!==e.length});for(var f=Math.ceil(t/n),o=0;o<f;o++)i.push(e.slice(n*o,n*(1+o)));return i.filter(function(e){return e&&0!==e.length})}});