Skip to content

lib: fix misleading argument of validateUint32

The type of the argument positive was declared as boolean|number, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either 0 or 1, which happen to work as expected because they are interpreted as false and true, respectively. However, passing 2 would silently lead to unexpected behavior. Thus, strictly make the argument a boolean.

Merge request reports

Loading