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
    entries
    Iterable<[K, Iterable<V>]>

    A map containing the unique groups of values.

    keyEqualer
    Equaler<K>

    Properties

    size

    Gets the number of unique keys.

    Declaration
    get size(): number;
    Property Value
    number

    Methods

    [Symbol.iterator]()

    Declaration
    [Symbol.iterator](): Iterator<Grouping<K, V>, any, undefined>;
    Returns
    Iterator<Grouping<K, V>, any, undefined>

    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
    selector
    (key: K, elements: Iterable<V>) => R

    A callback used to select results for each group.

    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.

    Returns
    boolean

    Generated by DocFX