deconstruct-js

Home > deconstruct-js > structPairs

structPairs() function

Returns an object with the given key-value pairs

Signature:

declare function structPairs<T extends DeconstructorPair>(pairs: readonly T[]): ComplexDeconstructor<ValueRecordFromDeconstructorPair<T>>;

Parameters

Parameter Type Description
pairs readonly T[]  

Returns:

ComplexDeconstructor<ValueRecordFromDeconstructorPair<T>>

Remarks

If you use TypeScript, add as const after the pairs array so you get type-checking for the resulting object.