caplin / FlexLayout

Docking Layout Manager for React
MIT License
919 stars 173 forks source link

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

Open Vampiro opened 1 year ago

Vampiro commented 1 year ago

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 commented 1 year ago

thanks for that, I've updated it

Vampiro commented 1 year ago

Awesome, thanks!