import { daffArrayToDict } from '@daffodil/core'
Converts an array into a dictionary.
Dictionary values are keyed by the return of the specified getKey.
function daffArrayToDict<T, R extends keyof Dictionary = keyof Dictionary>(
array: T[]
getKey: (val: T) => R
): Record<R, T>
| Parameter | array: T[] |
|---|---|
| Description |
| Parameter | getKey: (val: T) => R |
|---|---|
| Description |