Skip to content

Welshman Docs / @welshman/lib / fromPairs

Function: fromPairs() ​

fromPairs<T>(pairs): Record<string, T>

Defined in: packages/lib/src/Tools.ts:696

Creates object from array of key-value pairs

Type Parameters ​

• T

Parameters ​

pairs ​

[string, T, ...args: unknown[]][]

Array of [key, value] tuples

Returns ​

Record<string, T>

Object with keys and values from pairs