Files
collection.ts/src/collection/toObject.ts
2026-05-08 22:04:56 +02:00

7 lines
219 B
TypeScript

export type Key = keyof any
export type Object<K extends Key, V> = { [key in K]?: V }
export function toObject<K extends Key, V>(value: [K, V][]): Object<K, V> {
return Object.fromEntries(value) as Object<K, V>;
}