deshiknaves / caret-pos

Locate the current position of the caret. A plain JavaScript version of Caret.js.
MIT License
120 stars 15 forks source link

Fix value argument's default value #46

Open pohy opened 2 years ago

pohy commented 2 years ago

The getPosition function inside input.js checks strictly for undefined. Hence assigning null during the value sanitization is invalid. Also, the JSDoc for offset states that the values should be of types number or undefined