export const tupleToRecord = < KeyType extends string | number | symbol, ValueType >( tuples: [KeyType, ValueType][] ): Record => tuples.length > 0 ? (Object.assign as any)(...tuples.map(([key, val]) => ({ [key]: val }))) : {}