-
Notifications
You must be signed in to change notification settings - Fork 126
Add #[ts(optional)]
to struct
#366
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8e8fc64
Fix clippy warning
gustavo-shigueo 6692151
Add test
gustavo-shigueo 2b7a95a
Parse #[ts(optional)] on structs
gustavo-shigueo 1a13390
Add non Option<T> field to test
gustavo-shigueo 0aa63ea
Fix struct optional non-optional field
gustavo-shigueo 69e9987
Add runtime validation for `#[ts(optional)]`
gustavo-shigueo a562561
Turn Optional into an enum
gustavo-shigueo 6f064f5
Remove invalid optional attribute from test
gustavo-shigueo ad4f024
Remove extra methods for option inner type
gustavo-shigueo ade6a2f
Remove panic
gustavo-shigueo dcc7a46
compile-time checked `#[ts(optional)]` (#367)
NyxCode 95e0401
Remove invalid optional from test
gustavo-shigueo 4d1a6d4
Fix doc comment
gustavo-shigueo 0d51986
Show error message on the compiler's ascii graphic too
gustavo-shigueo c7d2c4a
Remove invalid optional from test - again, oops
gustavo-shigueo 033d096
Rename struct level attribute
gustavo-shigueo f72238f
Validate `optional_fields` compatibility with other attributes
gustavo-shigueo 21d03f5
Add extra test for `optional_fields = nullable`
gustavo-shigueo faa431f
Add docs
gustavo-shigueo 53941b5
#[ts(type)] overrides #[ts(optional_fields)]
gustavo-shigueo 3d0a048
Make #[ts(type)] and #[ts(optional)] incompatible
gustavo-shigueo 6fef0a0
Update CHANGELOG
gustavo-shigueo 625ab54
Merge branch 'main' into add_ts_optional_to_struct
gustavo-shigueo 5a48627
Fix CHANGELOG merge
gustavo-shigueo 768eb3d
Update MSRV
gustavo-shigueo e98966d
Update README
gustavo-shigueo 09cb5de
Fix clippy warning
gustavo-shigueo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Another option is just remove this whole thing, this way there'll be no panic (still, no compiler error). What will happen is that
#[ts(optional)]
will just do nothing when not using an Option type