level-up/shared/util.ts
Moritz Ruth 34fa93ad44
Some checks failed
Build / build (push) Failing after 39s
Change script types and add a few scenes
2025-04-12 18:44:43 +02:00

7 lines
No EOL
279 B
TypeScript

export const cSet = <T>(...values: T[]) => new Set(values)
export const cMap = <K extends string, V>(object: Partial<Record<K, V>>): Map<K, V> => {
const result = new Map<K, V>();
Object.entries(object).forEach(([k, v]) => result.set(k as K, v as V))
return result
}