Lookup Class
Package: @esfx/iter-lookup
Declaration
export declare class Lookup<K, V> implements Iterable<Grouping<K, V>>
Constructors
constructor(entries, keyEqualer)
Creates a new Lookup for the provided groups.
Declaration
constructor(entries: Iterable<[K, Iterable<V>]>, keyEqualer?: Equaler<K>);
Parameters
- keyEqualer
- Equaler<K>
Properties
size
Gets the number of unique keys.
Declaration
get size(): number;
Property Value
Methods
[Symbol.iterator]()
Declaration
[Symbol.iterator](): Iterator<Grouping<K, V>, any, undefined>;
Returns
applyResultSelector(selector)
Creates a Query
that maps each group in the Lookup.
Declaration
applyResultSelector<R>(selector: (key: K, elements: Iterable<V>) => R): Iterable<R>;
Type Parameters
- R
Parameters
Returns
Iterable<R>
get(key)
Gets the group for the provided key.
Declaration
get(key: K): Iterable<V>;
Parameters
- key
- K
A key.
Returns
Iterable<V>
has(key)
Declaration
has(key: K): boolean;
Parameters
- key
- K
A key. Gets a value indicating whether any group has the provided key.