@ag1/tuple
v1.1.1
Published
key-value tuple
Downloads
9
Readme
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' });