source: node_modules/es-toolkit/dist/compat/array/chunk.js

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 485 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const chunk$1 = require('../../array/chunk.js');
6const toArray = require('../_internal/toArray.js');
7const isArrayLike = require('../predicate/isArrayLike.js');
8
9function chunk(arr, size = 1) {
10 size = Math.max(Math.floor(size), 0);
11 if (size === 0 || !isArrayLike.isArrayLike(arr)) {
12 return [];
13 }
14 return chunk$1.chunk(toArray.toArray(arr), size);
15}
16
17exports.chunk = chunk;
Note: See TracBrowser for help on using the repository browser.