8000 fix(types): nullable relations are never undefined by olivierwilkinson · Pull Request #180 · mswjs/data · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(types): nullable relations are never undefined #180

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 1 commit into from
Dec 18, 2021

Conversation

olivierwilkinson
Copy link
Contributor
@olivierwilkinson olivierwilkinson commented Dec 15, 2021

I made a mistake when updating #158 after we merged #143, it is not actually possible for nullable relationships to be undefined, they are null instead. Sorry I let that slip by!

This is purely for proper annotation similarly to #158

It is not possible for the value of nullable relations to be undefined because:

  • if the relation does not have an initial value it defaults to null.
  • it is not possible to update the relation's value to be undefined after the fact.

@olivierwilkinson olivierwilkinson force-pushed the fix-nullable-relations-type branch from 254c11f to 66c1248 Compare December 15, 2021 18:16
It is not possible for the value of nullable relations to be undefined:
if the relation does not have an initial value during creation it
defaults to null and it is not possible to update the value to be
undefined.
@olivierwilkinson olivierwilkinson force-pushed the fix-nullable-relations-type branch from 66c1248 to bedfe4c Compare December 15, 2021 18:28
Copy link
Member
@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for spotting this, @olivierwilkinson! A great fix.

@kettanaito kettanaito merged commit c29cb14 into mswjs:main Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4238
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0