snapshot of https://github.com/raimohanska/ourboard.git (master, 2026-09-23; blobs > 131072B omitted)
Some checks failed
build / test (18.x) (push) Failing after 10s
build / lint (18.x) (push) Failing after 0s
build / docker-image (push) Has been skipped

This commit is contained in:
upstream-mirror
2026-09-23 16:16:17 +05:00
commit d57328655f
233 changed files with 21282 additions and 0 deletions

16
common/src/sets.ts Normal file
View File

@@ -0,0 +1,16 @@
export function toggleInSet<T>(item: T, set: Set<T>) {
if (set.has(item)) {
return new Set([...set].filter((i) => i !== item))
}
return new Set([...set].concat(item))
}
export function difference<A>(setA: Set<A>, setB: Set<A>) {
let _difference = new Set(setA)
for (let elem of setB) {
_difference.delete(elem)
}
return _difference
}
export const emptySet = <A>() => new Set<A>()