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 IP address validation #2059

Closed
fvckDesa opened this issue Feb 18, 2023 · 0 comments
Closed

Support IP address validation #2059

fvckDesa opened this issue Feb 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@fvckDesa
Copy link
Contributor

I have been adding email validation with ip address, I can make IP validation a build-in feature.
The result is like:

z.string().ip({ version: "v4" });

or

z.string().ipv4();
z.string().ipv6();
@JacobWeisenburger JacobWeisenburger added the enhancement New feature or request label Feb 19, 2023
colinhacks added a commit that referenced this issue Feb 26, 2023
* Add base implementation of string ip validation

For now check only IPv4

* Add IP version

If the version is not defined, the check goes
for a valid IP whether it is version 4 or 6

* Add IP in docs

* Implement IPv6 validation

* Use errToObj and update readme

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
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

2 participants