1.1.1 • Published 4 years ago
@ag1/tuple v1.1.1
Tuple Utils
Mimic tuple behavior of other language key, val.
Functions
toObject<T>(tuple: IKeyValTuple<T> | IKeyValTuple<T>[]): T
type fooType = { a: string; b: string };
const tupleList: IKeyValTuple<fooType>[] = [['a', 'a'], ['b', 'b']];
expect(toObject(tupleList)).toEqual({ a: 'a', b: 'b' });