You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dealing with strings that may have characters outside the ASCII range, String.prototype.normalize() often becomes an essential part of the processing/validation pipeline.
For this reason it would be nice to have a .normalize() validator/converter on strings, akin to .trim()/.uppercase()/.lowercase(). It would optionally accept a normalization form just like the original method, defaulting to NFC otherwise.
I wasn't going to open an issue until I had a PR ready, but I don't know how long that will take, so I thought I'd drop the request here in the meantime just in case someone else feels like having a go.
For tests the smartest thing to do is probably to have a string where the source and all 4 normalization forms are different from each other.
The text was updated successfully, but these errors were encountered:
When dealing with strings that may have characters outside the ASCII range,
String.prototype.normalize()
often becomes an essential part of the processing/validation pipeline.For this reason it would be nice to have a
.normalize()
validator/converter on strings, akin to.trim()
/.uppercase()
/.lowercase()
. It would optionally accept a normalization form just like the original method, defaulting to NFC otherwise.I wasn't going to open an issue until I had a PR ready, but I don't know how long that will take, so I thought I'd drop the request here in the meantime just in case someone else feels like having a go.
For tests the smartest thing to do is probably to have a string where the source and all 4 normalization forms are different from each other.
The text was updated successfully, but these errors were encountered: