Home > deconstruct-js > structPairs
Returns an object with the given key-value pairs
Signature:
declare function structPairs<T extends DeconstructorPair>(pairs: readonly T[]): ComplexDeconstructor<ValueRecordFromDeconstructorPair<T>>;
| Parameter | Type | Description |
|---|---|---|
| pairs | readonly T[] |
Returns:
ComplexDeconstructor<ValueRecordFromDeconstructorPair<T>>
If you use TypeScript, add as const after the pairs array so you get type-checking for the resulting object.