Closed micahriggan closed 5 years ago
If it was an AND then yes, it would fail, but this is an OR statement. Specifically this if is designed to catch things if the input is not a number or if it is not an integer. Something like '1'
or 1.1
would be example payloads which would trigger it, and 1
would be ignored.
Thanks. Did not realize you could call parseInt on a float. Thought it had to be a string.
https://github.com/bitpay/jsonPaymentProtocol/blob/972eaa88894716298e1227ad14e656d80c5e821d/index.js#L213
If the first clause of this statement fails, then the second clause will be impossible with !==
If the goal is to make sure the parameter is a number, I think we should remove the second clause or change it to