Constructors
constructor
- new default<T>(hash: ((value: T) => string)): default<T>
-
Parameters
-
hash: ((value: T) => string)
-
- (value: T): string
-
Returns string
Accessors
size
- get size(): number
-
Returns number
Methods
[iterator]
- [iterator](): IterableIterator<T>
-
Returns IterableIterator<T>
add
- add(...values: T[]): default<T>
-
addAll
- addAll(...valuesIterables: (Falsy | Iterable<T>)[]): default<T>
-
Parameters
-
Rest
...valuesIterables: (Falsy | Iterable<T>)[]
clear
- clear(): default<T>
-
entries
- entries(): IterableIterator<[string, T]>
-
Returns IterableIterator<[string, T]>
entryStream
- entryStream(): T extends T ? Stream<[string, T]> : never
-
Returns T extends T ? Stream<[string, T]> : never
forEach
- forEach(consumer: ((value: T, key: string) => any)): void
-
Parameters
-
consumer: ((value: T, key: string) => any)
-
- (value: T, key: string): any
-
Returns any
Returns void
get
- get(hash: string): undefined | T
-
Returns undefined | T
has
- has(...values: T[]): boolean
-
Returns boolean
hasAll
- hasAll(...valuesIterables: (Falsy | Iterable<T>)[]): boolean
-
Parameters
-
Rest
...valuesIterables: (Falsy | Iterable<T>)[]
Returns boolean
intersects
- intersects(set: default<T>): boolean
-
Returns boolean
keyStream
- keyStream(): Stream<string>
-
Returns Stream<string>
keys
- keys(): IterableIterator<string>
-
Returns IterableIterator<string>
remove
- remove(...values: T[]): boolean
-
Returns boolean
removeAll
- removeAll(...valuesIterables: (Falsy | Iterable<T>)[]): boolean
-
Parameters
-
Rest
...valuesIterables: (Falsy | Iterable<T>)[]
Returns boolean
replace
- replace(...values: T[]): default<T>
-
replaceAll
- replaceAll(...valuesIterables: (Falsy | Iterable<T>)[]): default<T>
-
Parameters
-
Rest
...valuesIterables: (Falsy | Iterable<T>)[]
retainNot
- retainNot(value: T): boolean
-
Returns boolean
toArray
- toArray(): T[]
-
Returns T[]
toggle
- toggle(has: boolean, ...values: T[]): default<T>
-
Parameters
-
has: boolean
-
Rest
...values: T[]
toggleAll
- toggleAll(has: boolean, ...valuesIterables: (Falsy | Iterable<T>)[]): default<T>
-
Parameters
-
has: boolean
-
Rest
...valuesIterables: (Falsy | Iterable<T>)[]
valueStream
- valueStream(): Stream<T>
-
Returns Stream<T>
values
- values(): IterableIterator<T>
-
Returns IterableIterator<T>
Adds the given values to the set, first removing any values that share the same hashes.