Files
actions/github/codeql-action-v2/node_modules/chunkd
..
2026-01-31 18:56:04 +01:00
2026-01-31 18:56:04 +01:00
2026-01-31 18:56:04 +01:00
2026-01-31 18:56:04 +01:00

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]