Skip to content

Commit

Permalink
chore(docs): add future to array
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosai106 committed Nov 23, 2024
1 parent 6e7c355 commit e073373
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps/docs/pages/schemas/array.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
```

0 comments on commit e073373

Please sign in to comment.