From e0733737edae44cde3313235d35c2d1411bf1e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20=C3=98sterkilde?= Date: Sat, 23 Nov 2024 10:08:38 +0100 Subject: [PATCH] chore(docs): add future to array --- apps/docs/pages/schemas/array.mdx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/docs/pages/schemas/array.mdx b/apps/docs/pages/schemas/array.mdx index 94c79b0..bedcdbf 100644 --- a/apps/docs/pages/schemas/array.mdx +++ b/apps/docs/pages/schemas/array.mdx @@ -24,4 +24,21 @@ try { } catch (error) { console.error('Parsing failed:', error.message); } +``` + +## Future + +In one of the next upcoming releases, the `Array` schema will support mixed schemas, so you'd be able to for example do the following: + +```ts +import { array, string, number } from '@nordic-ui/validathor'; + +const arrayRule = array([string(), number()]); + +try { + const parsedValue = arrayRule.parse(['Hello', 42, 'world']); + console.log('Parsed value:', parsedValue); +} catch (error) { + console.error('Parsing failed:', error.message); +} ``` \ No newline at end of file