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(#1747): Add Start and End to ZodString #1751

Conversation

santosmarco-caribou
Copy link
Contributor

This PR adds two type parameters to ZodString: Start and End. They are populated by the .startsWith() and .endsWith() methods to improve inference.

Screenshot 2022-12-24 at 2 39 56 AM

@netlify
Copy link

netlify bot commented Dec 24, 2022

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit bcb1406
🔍 Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/63a690b503f6990008d0d537
😎 Deploy Preview https://deploy-preview-1751--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 settings.

@colinhacks
Copy link
Owner

Thanks for the PR. I have some reservations discussed here: #1730 (comment)

@colinhacks
Copy link
Owner

Interesting idea, but I'd like to avoid adding type parameters onto the primitive schema types like ZodString to keep the types simpler in Intellisense. I generally think that's more important here, and this use case will be covered by a future template literal API anyway. But thanks!

@spiftire
Copy link

I would love to have this feature. Any plans to add this?

@stale
Copy link

stale bot commented May 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No activity in last 60 days label May 17, 2023
@stale stale bot closed this Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No activity in last 60 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants