MCPcopy Index your code
hub / github.com/tinyplex/tinybase / arrayNew

Function arrayNew

src/common/array.ts:4–7  ·  view source on GitHub ↗
(
  size: number,
  cb: (index: number) => Value,
)

Source from the content-addressed store, hash-verified

2import {EMPTY_STRING} from './strings.ts';
3
4export const arrayNew = <Value>(
5 size: number,
6 cb: (index: number) => Value,
7): Value[] => arrayMap(new Array(size).fill(0), (_, index) => cb(index));
8
9export const arrayHas = <Value>(array: Value[], value: Value): boolean =>
10 array.includes(value);

Callers 3

ProviderFunction · 0.90
ProviderFunction · 0.90
getTicksFunction · 0.90

Calls 1

arrayMapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…