update: game core flow pages

This commit is contained in:
Vick Scarlet
2026-08-16 20:06:16 +08:00
committed by 神戸小鳥
parent 25bd9ce2b7
commit 0c0fac5bfd
34 changed files with 890 additions and 768 deletions
+8 -2
View File
@@ -34,6 +34,12 @@ export function shuffle<T>(array: T[], rng?: RNG): T[] {
return result
}
export function keys<T extends object>(obj: T): (keyof T)[] {
return Object.keys(obj) as (keyof T)[]
export function keys<T extends object, K extends keyof T = never>(
obj: T,
filter?: K[],
): Exclude<keyof T, K>[] {
const allKeys = Object.keys(obj) as (keyof T)[]
if (!filter || filter.length === 0) return allKeys as Exclude<keyof T, K>[]
const filterSet = new Set<keyof T>(filter)
return allKeys.filter(key => !filterSet.has(key)) as Exclude<keyof T, K>[]
}