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 } } }
objects to index
keys used for indexing
Generated using TypeDoc
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 } } }