Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "indexed"

Index

Functions

Functions

Const indexed

  • indexed<T>(records: Iterable<T>, ks: keyof T[]): EquivMap<object, Set<T>>
  • Takes an iterable of plain objects and array of indexing keys. Calls selectKeysObj on each value and uses returned objects as new keys to group original values. Returns a new EquivMap of sets.

    indexed(
      new Set([{a: 1, b: 1}, {a: 1, b: 2}, {a: 1, b: 1, c: 2}]),
      ["a","b"]
    )
    // EquivMap {
    //   { a: 1, b: 1 } => Set { { a: 1, b: 1 }, { a: 1, b: 1, c: 2 } },
    //   { a: 1, b: 2 } => Set { { a: 1, b: 2 } } }

    Type parameters

    • T

    Parameters

    • records: Iterable<T>

      objects to index

    • ks: keyof T[]

      keys used for indexing

    Returns EquivMap<object, Set<T>>

Generated using TypeDoc