Skip to main content

@terascope/utils / big-set / BigSet

Class: BigSet<T>

Avoid v8 maximum size for Set by spreading the cache across multiple Sets. This class has the same API as Set but minus more differences in ->add and ->forEach

Type parameters

Type parameter
T

Constructors

new BigSet()

new BigSet<T>(values?): BigSet<T>

Parameters

ParameterType
values?null | readonly T[]

Returns

BigSet<T>

Source

packages/utils/src/big-set.ts:15

Properties

maxMapSize

readonly maxMapSize: number

Source

packages/utils/src/big-set.ts:10


DEFAULT_MAX_SIZE

static DEFAULT_MAX_SIZE: number = defaultMaxSize

Source

packages/utils/src/big-set.ts:8

Accessors

size

get size(): number

Returns

number

Source

packages/utils/src/big-set.ts:66

Methods

[iterator]()

[iterator](): IterableIterator<T>

Returns

IterableIterator<T>

Source

packages/utils/src/big-set.ts:92


add()

add(value): Set<T>

Parameters

ParameterType
valueT

Returns

Set<T>

Source

packages/utils/src/big-set.ts:22


clear()

clear(): void

Returns

void

Source

packages/utils/src/big-set.ts:53


delete()

delete(value): boolean

Parameters

ParameterType
valueT

Returns

boolean

Source

packages/utils/src/big-set.ts:39


forEach()

forEach(callbackFn, thisArg?): void

Parameters

ParameterType
callbackFn(value, value2, map) => void
thisArg?unknown

Returns

void

Source

packages/utils/src/big-set.ts:80


has()

has(value): boolean

Parameters

ParameterType
valueT

Returns

boolean

Source

packages/utils/src/big-set.ts:32