Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dynamic arrays #20

Open
Kosai106 opened this issue Oct 12, 2024 · 0 comments
Open

Support dynamic arrays #20

Kosai106 opened this issue Oct 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Kosai106
Copy link
Collaborator

Arrays were just introduced in #18, however one outstanding issue with them is that they only currently allow allows for array of one type of input.

Example

Valid

v.array([v.string()]).parse(['hello', 'world']);
v.array([v.number()]).parse([123, 987]);

Invalid

v.array([v.string(), v.number()]).parse(['hello', 123, 'world']); // Error: Expected a number

It would be great to have this behaviour working.

@Kosai106 Kosai106 added the enhancement New feature or request label Oct 12, 2024
@Kosai106 Kosai106 self-assigned this Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant