Skip to content

Documentation


Documentation / @blazetrails/activesupport / indexBy

Function: indexBy() ​

Call Signature ​

indexBy<T, K>(collection, fn): Record<K, T>

Defined in: packages/activesupport/lib/core-ext/enumerable.ts:47

Type Parameters ​

Type Parameter
T
K extends string

Parameters ​

ParameterType
collectionIterable<T, any, any> | Each<T, unknown>
fn(item) => K

Returns ​

Record<K, T>

Call Signature ​

indexBy<T, K>(collection, fn): Hash<K, T>

Defined in: packages/activesupport/lib/core-ext/enumerable.ts:51

Type Parameters ​

Type Parameter
T
K

Parameters ​

ParameterType
collectionIterable<T, any, any> | Each<T, unknown>
fn(item) => K

Returns ​

Hash<K, T>

Call Signature ​

indexBy<T>(collection): Enumerator<T>

Defined in: packages/activesupport/lib/core-ext/enumerable.ts:52

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
collectionIterable<T, any, any> | Each<T, unknown>

Returns ​

Enumerator<T>