MCPcopy Create free account
hub / github.com/decaporg/decap-cms / batch

Function batch

packages/decap-cms-backend-gitlab/src/API.ts:204–209  ·  view source on GitHub ↗
(items: T[], maxPerBatch: number, action: (items: T[]) => void)

Source from the content-addressed store, hash-verified

202}
203
204function batch<T>(items: T[], maxPerBatch: number, action: (items: T[]) => void) {
205 for (let index = 0; index < items.length; index = index + maxPerBatch) {
206 const itemsSlice = items.slice(index, index + maxPerBatch);
207 action(itemsSlice);
208 }
209}
210
211export default class API {
212 apiRoot: string;

Callers 1

APIClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected