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鈥檒l 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