Skip to content

Commit c494cd2

Browse files
authored
Allow INT/FLOAT represent list of numbers (#274)
1 parent c00e2fd commit c494cd2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/types/apiTypes.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ const zIntInputSpec = inputSpec([
188188
min: z.number().optional(),
189189
max: z.number().optional(),
190190
step: z.number().optional(),
191-
default: z.number().optional()
191+
// Note: Many node authors are using INT to pass list of INT.
192+
// TODO: Add list of ints type.
193+
default: z.union([z.number(), z.array(z.number())]).optional()
192194
})
193195
])
194196

@@ -199,7 +201,9 @@ const zFloatInputSpec = inputSpec([
199201
max: z.number().optional(),
200202
step: z.number().optional(),
201203
round: z.union([z.number(), z.literal(false)]).optional(),
202-
default: z.number().optional()
204+
// Note: Many node authors are using FLOAT to pass list of FLOAT.
205+
// TODO: Add list of floats type.
206+
default: z.union([z.number(), z.array(z.number())]).optional()
203207
})
204208
])
205209

0 commit comments

Comments
 (0)