MCPcopy
hub / github.com/immutable-js/immutable-js / ensureSize

Function ensureSize

src/TrieUtils.ts:33–41  ·  view source on GitHub ↗
(iter: Collection<unknown, unknown>)

Source from the content-addressed store, hash-verified

31export function OwnerID() {}
32
33export function ensureSize(iter: Collection<unknown, unknown>): number {
34 // @ts-expect-error size should exists on Collection
35 if (iter.size === undefined) {
36 // @ts-expect-error size should exists on Collection, __iterate does exist on Collection
37 iter.size = iter.__iterate(returnTrue);
38 }
39 // @ts-expect-error size should exists on Collection
40 return iter.size;
41}
42
43export function wrapIndex(
44 iter: Collection<unknown, unknown>,

Callers 5

__iterateMethod · 0.90
__iteratorMethod · 0.90
reverseFactoryFunction · 0.90
countFunction · 0.90
wrapIndexFunction · 0.85

Calls 1

__iterateMethod · 0.45

Tested by

no test coverage detected