codeql-action/node_modules/chunkd
github-actions[bot] 0da815296a Update checked-in dependencies 2022-02-24 17:03:29 +00:00
..
dist replace jest with ava 2020-05-13 11:13:27 +01:00
LICENSE replace jest with ava 2020-05-13 11:13:27 +01:00
README.md replace jest with ava 2020-05-13 11:13:27 +01:00
package.json Update checked-in dependencies 2022-02-24 17:03:29 +00:00

README.md

chunkd

Get a chunk of an array based on the total number of chunks and current index

Install

yarn add [--dev] chunkd

Example

const chunkd = require("chunkd")

chunkd([1, 2, 3, 4], 0, 3) // [1, 2]
chunkd([1, 2, 3, 4], 1, 3) // [3]
chunkd([1, 2, 3, 4], 2, 3) // [4]