Convert pos object to array on parsing (#147)

This commit is contained in:
Chenlei Hu
2024-07-17 20:57:14 -04:00
committed by GitHub
parent 05d5896c82
commit 7619e9159b
3 changed files with 14 additions and 11 deletions

View File

@@ -45,7 +45,7 @@ const zProperties = z
.passthrough();
const zVector2 = z.union([
z.object({ 0: z.number(), 1: z.number() }),
z.object({ 0: z.number(), 1: z.number() }).transform((v) => [v[0], v[1]]),
z.tuple([z.number(), z.number()]),
]);