From 696d5305b852bc34712f3aad215a1e1cf304ca90 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 29 Sep 2021 17:24:45 +0700 Subject: [PATCH] Improve performance Thanks to @ready-research for the tip. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0877a74..b0002cb 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,7 @@ module.exports = ( // `my_URLstring` → `my_url_string` return decamelized .replace( - /(\p{Uppercase_Letter}+)(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, + /(\p{Uppercase_Letter})(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, replacement ) .toLowerCase();