Function
arrayNew
(
size: number,
cb: (index: number) => Value,
)
Source from the content-addressed store, hash-verified
| 2 | import {EMPTY_STRING} from './strings.ts'; |
| 3 | |
| 4 | export const arrayNew = <Value>( |
| 5 | size: number, |
| 6 | cb: (index: number) => Value, |
| 7 | ): Value[] => arrayMap(new Array(size).fill(0), (_, index) => cb(index)); |
| 8 | |
| 9 | export const arrayHas = <Value>(array: Value[], value: Value): boolean => |
| 10 | array.includes(value); |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…