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

Function collSizeN

src/common/coll.ts:7–13  ·  view source on GitHub ↗
(collSizer: (map: Coll<Child>) => number)

Source from the content-addressed store, hash-verified

5
6const collSizeN =
7 <Child>(collSizer: (map: Coll<Child>) => number) =>
8 (coll: Coll<Coll<Child>>): number =>
9 arrayReduce<Coll<Child>, number>(
10 collValues(coll),
11 (total, coll2) => total + collSizer(coll2),
12 0,
13 );
14
15export const collSize = (coll: Coll<unknown> | undefined): number =>
16 coll?.size ?? 0;

Callers 1

coll.tsFile · 0.70

Calls 2

arrayReduceFunction · 0.90
collValuesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…