MCPcopy Create free account
hub / github.com/alibaba/open-code-review / chunkArray

Function chunkArray

scripts/github-actions/post-review-comments.js:1057–1063  ·  view source on GitHub ↗
(items, size)

Source from the content-addressed store, hash-verified

1055// slice is the remainder (length === size when items.length is a multiple of
1056// size, otherwise items.length mod size).
1057function chunkArray(items, size) {
1058 const chunks = [];
1059 for (let i = 0; i < items.length; i += size) {
1060 chunks.push(items.slice(i, i + size));
1061 }
1062 return chunks;
1063}
1064
1065function setStatsOutputs(out, stats, batchCounters, batchSize) {
1066 out("comments_total", String(stats.total));

Callers 2

runPostReviewCommentsFunction · 0.85
testChunkArrayFunction · 0.85

Calls

no outgoing calls

Tested by 1

testChunkArrayFunction · 0.68