TL;DR -

There is a bug in the ip validation function, it returns true for invalid ip addresses such as 10.0.0.01
validator.isIP('10.0.0.01');
expected false, returns true
I will do some investigation on this bug and I will get back to you.
I will do some investigation on this bug and I will get back to you.
Thanks. if I can help, found a working regex here - https://www.regextester.com/22
The main issue is from this line -
https://github.com/validatorjs/validator.js/blob/0d204da14f640fd2a8bf1874b6995128ff28409d/lib/isIP.js#L41
Good catch. PR welcome by all means! @barintsights
@profnandaa here you go https://github.com/validatorjs/validator.js/pull/1211
This Issue can be closed @profnandaa @ezkemboi @chriso - housekeeping ;)
Most helpful comment
Thanks. if I can help, found a working regex here - https://www.regextester.com/22
The main issue is from this line -
https://github.com/validatorjs/validator.js/blob/0d204da14f640fd2a8bf1874b6995128ff28409d/lib/isIP.js#L41