MCPcopy Create free account
hub / github.com/Snapchat/Valdi / arrayRepeat

Function arrayRepeat

src/valdi_modules/src/valdi/foundation/src/array.ts:4–6  ·  view source on GitHub ↗
(size: number, value: T)

Source from the content-addressed store, hash-verified

2 * Create an array of arbitrary size that contains x times the same value
3 */
4export function arrayRepeat<T>(size: number, value: T): T[] {
5 return arrayGenerate(size, () => value);
6}
7
8/**
9 * Create an array of arbitrary size by calling a function x times and saving its return value in the array

Callers

nothing calls this directly

Calls 1

arrayGenerateFunction · 0.85

Tested by

no test coverage detected