Elius94 / console-gui-tools

A simple library to draw option menu or other popup inputs and layout on Node.js console.
MIT License
106 stars 17 forks source link

Fix #68: Do strict testing for null | undefined on selected #69

Closed Compositr closed 1 year ago

Compositr commented 1 year ago

This PR addresses #68 by changing the following line:

https://github.com/Elius94/console-gui-tools/blob/6e68febe7cfa364b236d48f7ec110e1fe41fd2d1/src/components/widgets/OptionPopup.ts#L79

to

https://github.com/Compositr/console-gui-tools/blob/abd0ee04aa859e74864d7e5a2cf47276fa3b8f91/src/components/widgets/OptionPopup.ts#L79

        if (selected === undefined || selected === null) throw new Error("OptionPopup selected is required")

This strictly checks for null | undefined fixing the behaviour described in #68

Elius94 commented 1 year ago

Super!!!!