From ba47847e39d19bb2e7175563721f0be7ccd6bb60 Mon Sep 17 00:00:00 2001 From: thepaperpilot <thepaperpilot@gmail.com> Date: Sun, 17 Jul 2022 20:21:03 -0500 Subject: [PATCH] Fix LayerData typing for handling arrays --- src/game/player.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/player.ts b/src/game/player.ts index aa4e789..6271629 100644 --- a/src/game/player.ts +++ b/src/game/player.ts @@ -42,7 +42,7 @@ export type Player = ProxiedWithState<PlayerData>; /** A layer's save data. Automatically unwraps refs. */ export type LayerData<T> = { [P in keyof T]?: T[P] extends (infer U)[] - ? LayerData<U>[] + ? Record<string, LayerData<U>> : T[P] extends Record<string, never> ? never : T[P] extends Ref<infer S>