-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isLength fails with some emojis #1941
Comments
BTW: tried some other implementations and the only one I found correct for this string is lodash.toArray - IMO using this same implementation should solve the issue:
PD: underscore.toArray didn't work. |
Do you also know why it fails? |
My "why" was in the lodash tip ;) Probably in the lines of : other useful links Sorry don't have much time for a PR right now :( BTW: I'm actually using express-validator library who relies on this - will end up using a custom validator in the meanwhile |
I'm a beginner at Unicode. I just want to add in my thoughts to test my knowledge and help out :). In case I mention anything inaccurate, I apologize in advance
It seems like π³οΈ is the offending character in that string. Note that it is not the same as π³, which would not have caused this issue. The offending flag char consists of three distinct escape sequences. Specifically, it has a:
Thus, it is not simply an astral symbol but a grapheme cluster. The current implementation of |
#1967 merged, watch out for next version |
isLength fail with some emojis.
Examples
Additional context
Validator.js version: latest
Node.js version: 14.19.0
OS platform: macOS
The text was updated successfully, but these errors were encountered: