Closed MayRain1999 closed 5 years ago
@ezrqnkemboi -- can investigate this please?
Yes, will do that @profnandaa. Will get some feedback on the results.
I have done my research on this and found that the issue is about copying and pasting. When pasting, it seems that there is a whitespace/weird character created at the end of the numeric. For instance in this code:
console.log("validator.isNumeric('6613476279')",validator.isNumeric("6613476279"))
If you paste somewhere this code, then try a backspace/delete from the end of number 9, instead of removing digit 9, it will remove the whitespace or weird character. Then, when you run the code, it will finally return true.
Thus, from my research, I can conclude that:
Someone else can add their thoughts. But, if all parties are satisfied, then the issue can be closed.
cc @profnandaa and @xiaopingzhang0207
Could you running it through trim before checking .isNumeric
?
-na
On Sun, Aug 18, 2019 at 11:27 PM Ezrqn Kemboi notifications@github.com wrote:
I have done my research on this and found that the issue is about copying and pasting. When pasting, it seems that there is a whitespace/weird character created at the end of the numeric. For instance in this code:
console.log("validator.isNumeric('6613476279')",validator.isNumeric("6613476279"))
If you paste somewhere this code, then try a backspace/delete from the end of number 9, instead of removing digit 9, it will remove the whitespace or weird character. Then, when you run the code, it will finally return true.
Thus, from my research, I can conclude that:
- Copy-pasting items sometimes might bring unnecessary characters.
- This is not a bug (It is a created bug from pasting).
- When we try to solve the issue of pasting digits, it might validate unnecessary characters, which are not digits.
Someone else can add their thoughts. But, if all parties are satisfied, then the issue can be closed.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/validatorjs/validator.js/issues/1079?email_source=notifications&email_token=AAB7ZEPCNL2FOKYPLVPBAA3QFGWCNA5CNFSM4IKS3AX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4RHQIA#issuecomment-522352672, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB7ZEK7R3D5MIKU4PCNCYDQFGWCNANCNFSM4IKS3AXQ .
--
*___Nandaa *Anthony ,Software Craftsman & Mentor Twitter/Github: @profnandaa https://twitter.com/profnandaa
Alright @profnandaa, I will do that and get back.
Could you running it through trim before checking
.isNumeric
? … -na On Sun, Aug 18, 2019 at 11:27 PM Ezrqn Kemboi @.> wrote: I have done my research on this and found that the issue is about copying and pasting. When pasting, it seems that there is a whitespace/weird character created at the end of the numeric. For instance in this code: console.log("validator.isNumeric('6613476279')",validator.isNumeric("6613476279")) If you paste somewhere this code, then try a backspace/delete from the end of number 9, instead of removing digit 9, it will remove the whitespace or weird character. Then, when you run the code, it will finally return true. Thus, from my research, I can conclude that: - Copy-pasting items sometimes might bring unnecessary characters. - This is not a bug (It is a created bug from pasting). - When we try to solve the issue of pasting digits, it might validate unnecessary characters, which are not digits. Someone else can add their thoughts. But, if all parties are satisfied, then the issue can be closed. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1079?email_source=notifications&email_token=AAB7ZEPCNL2FOKYPLVPBAA3QFGWCNA5CNFSM4IKS3AX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4RHQIA#issuecomment-522352672>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB7ZEK7R3D5MIKU4PCNCYDQFGWCNANCNFSM4IKS3AXQ . -- ___Nandaa Anthony ,Software Craftsman & Mentor Twitter/Github: *@profnandaa https://twitter.com/profnandaa
I have tried trim but does not work.
Thank you for your answer.
The first number is pasted into the code.second and third number is manually entered. Inconsistent execution results