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

Model.getNodeById return type should be Node | undefined #377

Open
Vampiro opened this issue Feb 21, 2023 · 2 comments
Open

Model.getNodeById return type should be Node | undefined #377

Vampiro opened this issue Feb 21, 2023 · 2 comments

Comments

@Vampiro
Copy link

Vampiro commented Feb 21, 2023

Describe the bug

The return type for Model.getNodeById is showing as Node when it could possibly be undefined due to no node with the given id existing. It should be explicitly marked as Node | undefined.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Call const node = model.getNodeById("something that does not exist"). node will show as being of type Node when it's possible that it's undefined.

Expected behavior

Types to be correct.

Operating System

Windows

Browser Type?

Chrome

Browser Version

110

Screenshots or Videos

None

Additional context

No response

@nealus
Copy link
Collaborator

nealus commented Feb 21, 2023

thanks for that, I've updated it

@Vampiro
Copy link
Author

Vampiro commented Feb 21, 2023

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants