Lodash Unicode Normalization Gaps and Limits

Lodash is one of the most widely adopted JavaScript utility libraries, but its string parsing suite relies on custom regular expressions and basic character mappings rather than standard Unicode specifications. Consequently, Lodash natively lacks implementation for standard Unicode Normalization Forms (NFC, NFD, NFKD, and NFKC), compatibility decompositions, comprehensive script deburring, and full grapheme cluster segmentation. This article outlines the specific Unicode normalization strategies that Lodash lacks natively and details the technical limitations of its built-in string functions.

Absence of Unicode Normalization Forms (UAX #15)

Lodash does not natively implement or invoke any of the four standard Unicode Normalization Forms defined by Unicode Standard Annex #15:

Instead of leveraging JavaScript's native String.prototype.normalize(), functions like _.kebabCase, _.camelCase, _.words, and _.deburr rely on hardcoded ASCII/Latin-based regular expressions.

Lack of Compatibility Equivalence (NFKD/NFKC Transformations)

Because Lodash lacks compatibility normalization strategies, it cannot parse or standardize characters that convey identical semantic meaning but differ typographically. Specifically, Lodash lacks:

Latin-Restricted Diacritic Removal in _.deburr

Lodash provides _.deburr to strip diacritics, which many casing functions use internally. However, its normalization strategy is limited to:

  1. A manual mapping dictionary covering only Latin-1 Supplement and Latin Extended-A characters.
  2. A regular expression that strips a narrow range of combining diacritical marks ([\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]).

Because of this design, Lodash lacks normalization for:

Missing Full Unicode Case Folding (UAX #21)

Functions such as _.toLower, _.lowerCase, _.toUpper, and _.upperCase delegate to JavaScript's standard toLowerCase() and toUpperCase() without implementing full Unicode Case Folding. This leaves several gaps:

Absence of Standard Grapheme Cluster Segmentation (UAX #29)

Lodash functions that divide strings—such as _.words, _.truncate, and _.split—rely on internal regular expressions designed to capture basic surrogate pairs, but they do not implement modern Extended Grapheme Cluster normalization strategies. As a result, Lodash fails to parse: