Move hints back to strings, make sure the strings are what the user asked for

This commit is contained in:
Jon Staab
2024-04-02 16:35:26 -07:00
parent d159b94eeb
commit 8319ba4862
5 changed files with 91 additions and 98 deletions
-14
View File
@@ -60,20 +60,6 @@ export const groupBy = <T>(f: (x: T) => string, xs: T[]) => {
return r
}
export const pushToKey = <T>(m: Record<string, T[]> | Map<string, T[]>, k: string, v: T) => {
if (m instanceof Map) {
const a = m.get(k) || []
a.push(v)
m.set(k, a)
} else {
m[k] = m[k] || []
m[k].push(v)
}
return m
}
export const sample = <T>(n: number, xs: T[]) => {
const result: T[] = []