Skip to content

Conversation

@Ayoub-Mabrouk
Copy link
Contributor

Invalid length values (Infinity, -Infinity, negative numbers, NaN) were not properly validated. parseInt(Infinity, 10) returns NaN, which would always fail length validation checks since NaN !== null is true, causing unexpected validation errors.

Add validation to ensure parsed length is finite and non-negative. Invalid values are now treated as null (no length validation), matching the intended behavior when length is not specified.

Add test to verify invalid length values are handled correctly.

Invalid length values (Infinity, -Infinity, negative numbers, NaN)
were not properly validated. parseInt(Infinity, 10) returns NaN,
which would always fail length validation checks since NaN !== null
is true, causing unexpected validation errors.

Add validation to ensure parsed length is finite and non-negative.
Invalid values are now treated as null (no length validation),
matching the intended behavior when length is not specified.

Add test to verify invalid length values are handled correctly.
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

Successfully merging this pull request may close these issues.

1 participant