-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve types #25
Improve types #25
Conversation
This option removes `undefined` from number and boolean values and provides default values with `0` and `false`, respectively. PocketBase does this automatically under the hood, but this is not reflected in the collection schema.
# [2.2.0-next.1](v2.1.0...v2.2.0-next.1) (2025-01-19) ### Features * **schema:** add option to improve types ([d8c9780](d8c9780))
Using `z.default` adds `undefined` to generated types. Not sure why, since I explicitly provide a default value so that the property cannot be `undefined` but well... More info: https://stackoverflow.com/questions/76396222/zod-using-optional-with-default-infers-the-wrong-type
# [2.2.0-next.2](v2.2.0-next.1...v2.2.0-next.2) (2025-01-20) ### Bug Fixes * **schema:** remove default values from improved types ([82b6b70](82b6b70))
🎉 This PR is included in version 2.2.0-next.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small cosmetical suggestions in text/comments.
Aside from that nothing speaks against merging this PR from my side.
Nice that the default returns of the Pocketbase API can now also be used in the loader.
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Changes
This
improveTypes
option removesundefined
from number and boolean values. PocketBase does return0
andfalse
automatically, but this is not reflected in the collection schema.