-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
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.