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

feat: added support for hostname method in z.string() #3589 #3692

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Kumar06Lav
Copy link

Added support for the hostname method in z.string() for enhanced string validation. This feature introduces a dedicated method to validate domain names, including Punycode, as well as IPv4 and IPv6 addresses(in square brackets). The new validation method ensures that valid hostnames meet the appropriate criteria and excludes invalid patterns.

This implementation was done for ticket #3589.

Changes:

Implemented the hostname method to validate:
Domain names, including those encoded in Punycode.
IPv4 addresses.
IPv6 addresses enclosed in square brackets.
Updated regex patterns to accurately handle valid and invalid hostname cases.
Added comprehensive test cases to ensure robustness and correctness of the new validation method.
Updated documentation to include details about the hostname method and usage examples.

Copy link

netlify bot commented Aug 8, 2024

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8edc00f
🔍 Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/6703a33563043f0008bc52a4
😎 Deploy Preview https://deploy-preview-3692--guileless-rolypoly-866f8a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Kumar06Lav
Copy link
Author

@colinhacks Could you please help me with review of my PR and merging it(if everything is fine)?

deno/lib/types.ts Outdated Show resolved Hide resolved
deno/lib/types.ts Outdated Show resolved Hide resolved
@itxtoledo
Copy link

any updates @colinhacks ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants