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

Document id / url type guards can accept unknown #362

Closed

Conversation

marionauta
Copy link
Contributor

  • Type guards usually accept unknown value type to be as generic as possible.
  • It allows more values to be checked, like undefined. The isValidAutomergeUrl was already accepting null and undefined values. This PR extends that.
  • This shouldn't break existing code since users are already using the guards with strings.
isValidDocumentId(undefined) // false
isValidDocumentId(1) // false

@pvh
Copy link
Member

pvh commented Jul 24, 2024

Good point! I added a test for a previously unrequestable value and merged it. Thanks.

@pvh pvh closed this Jul 24, 2024
@marionauta marionauta deleted the feat/document-type-guards branch July 25, 2024 08:15
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.

2 participants