From 9744e6c54d3374e13078fa9c27397c7bee765a8a Mon Sep 17 00:00:00 2001 From: Dirk de Visser Date: Sun, 14 May 2023 12:45:52 +0200 Subject: [PATCH] chore(docs): add `T.array().convert()` to the docs --- .../generators/build-structure/types-and-validators.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/generators/build-structure/types-and-validators.md b/docs/generators/build-structure/types-and-validators.md index 55199cdcc3..59b1c971a8 100644 --- a/docs/generators/build-structure/types-and-validators.md +++ b/docs/generators/build-structure/types-and-validators.md @@ -292,12 +292,18 @@ T.date().inThePast(); // Accept dates that represent a datetime in the past. ```ts T.array().values(T.bool()); // -> Typescript type: boolean[] -// -> Valid validator inputs: true, [false] +// -> Valid validator inputs: [true], [false] // -> Validator outputs: [true], [false] -// Note the auto conversion to array for the first input. T.array().min(1); // Enforce a minimum number of items T.array().max(5); // Enforce a maximum number of items + +T.array().values(T.bool()).convert(); // Convert non-array values to an array +// -> Typescript input type: boolean|boolean[] +// -> Typescript output type: boolean[] +// -> Valid validator inputs: true, [false] +// -> Validator outputs: [true], [false] +// Note the auto conversion to array for the first input. ``` ## Object