Skip to content

Commit 9744e6c

Browse files
committed
chore(docs): add T.array().convert() to the docs
1 parent d3aabbd commit 9744e6c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/generators/build-structure/types-and-validators.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,18 @@ T.date().inThePast(); // Accept dates that represent a datetime in the past.
292292
```ts
293293
T.array().values(T.bool());
294294
// -> Typescript type: boolean[]
295-
// -> Valid validator inputs: true, [false]
295+
// -> Valid validator inputs: [true], [false]
296296
// -> Validator outputs: [true], [false]
297-
// Note the auto conversion to array for the first input.
298297

299298
T.array().min(1); // Enforce a minimum number of items
300299
T.array().max(5); // Enforce a maximum number of items
300+
301+
T.array().values(T.bool()).convert(); // Convert non-array values to an array
302+
// -> Typescript input type: boolean|boolean[]
303+
// -> Typescript output type: boolean[]
304+
// -> Valid validator inputs: true, [false]
305+
// -> Validator outputs: [true], [false]
306+
// Note the auto conversion to array for the first input.
301307
```
302308

303309
## Object

0 commit comments

Comments
 (0)