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: satisfies support #1748

Merged
merged 1 commit into from
Aug 14, 2023
Merged

feat: satisfies support #1748

merged 1 commit into from
Aug 14, 2023

Conversation

amyjko
Copy link
Contributor

@amyjko amyjko commented Aug 14, 2023

This implements support for the TypeScript 4.9 'satisfies' operator. I did the following:

  • Created a new SubNodeParser to handle ts.SatisfiesExpression nodes. It just resolves to the type of it's expression, ignoring the satisfies type. There is some argument to be made that the type should resolve to the satisfies type, and not the type of the expression, since the satisfied type is often narrower than the declared or inferred type, but I decided to preserve the current behavior rather than introduce some new semantics to the schema generation.

  • I added the new node type to the chainNodeParer in the parser factoy.

  • I added a test to valid-data-type.test.js that verifies that a schema is successfully generated based on the expression's type, rather than throwing an UnknownNodeError.

All tests pass, and there are no linting warnings or errors.

I'm pretty sure I followed all of the current patterns, but I'm happy to make any adjustments.

Thanks for maintaining!

closes #1532

Version

Published prerelease version: v1.3.0-next.9

Changelog

🎉 This release contains work from new contributors! 🎉

Thanks for all your work!

❤️ Amy J. Ko (@amyjko)

❤️ Code From Anywhere (@CodeFromAnywhere)

❤️ Chris (@cengels)

❤️ Grigas (@grigasp)

❤️ Mario DeSousa (@mdesousa)

❤️ Grant Dickinson (@grant-d)

🚀 Enhancement

🐛 Bug Fix

⚠️ Pushed to next

🔩 Dependency Updates

Authors: 12

@domoritz domoritz changed the title Fixed #1532 satisfies support fix: satisfies support, closes #1532 Aug 14, 2023
@domoritz domoritz changed the title fix: satisfies support, closes #1532 feat: satisfies support Aug 14, 2023
@domoritz
Copy link
Member

See, thank you @amyjko!

@domoritz domoritz merged commit 18648b2 into vega:next Aug 14, 2023
4 checks passed
@github-actions
Copy link

🚀 PR was released in v1.3.0 🚀

@github-actions github-actions bot added released This issue/pull request has been released. and removed prerelease labels Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support TypeScript 4.9 satisfies operator
2 participants