3 ms·
> It’s extremely uncommon, lodash notwithstanding, for JS code to have a dense set of regex partials full of Unicode escapes, even with modern build tools. It’s
by yaseer 6y ago
> It’s extremely uncommon, lodash notwithstanding, for JS code to have a dense set of regex partials full of Unicode escapes, even with modern build tools. It’s a lot more common for malicious scripts.
A very good point, I hadn't looked at it that way. It makes me wonder why lodash would need this kind of construct.
- spiralx 6y agoMy guess is string case conversion functions, of which Lodash has quite a few, and parsing the micro-templates it has built-in. The case conversion regexes are likely defined in one place.