Something went wrong. Try again.
Starship Simulator Controls thoriumsim.com
Something went wrong. Try again.
463 B · 16 lines
TypeScript
at develop
1234567891011121314151617import z from "zod";
const systemRooms = z.object({ roomId: z.number().optional() }).default({});
export const shipSystems = z .object({ /** * The IDs of the ship system entities assigned to this ship * and the rooms they are assigned to */ shipSystems: z .union([z.array(z.tuple([z.number(), systemRooms])), z.map(z.number(), systemRooms)]) .default([]) .transform((val) => (val instanceof Map ? val : new Map(val))), }) .default({});