From 50752fae9f9afef970fdfb22e5a2a0344955bebf Mon Sep 17 00:00:00 2001 From: Elliot Iddon Date: Sat, 3 Sep 2022 17:13:37 +0100 Subject: [PATCH] Fix non-global regexes --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0a746a7..0328759 100644 --- a/index.js +++ b/index.js @@ -24,13 +24,13 @@ try { result = result.replaceAll('/', '-'); // Replace excessive underscores - result = result.replaceAll(/___+/, '__'); + result = result.replaceAll(/___+/g, '__'); // Lower case result = result.toLowerCase(); // Remove invalid characters - result = result.replaceAll(/[^a-z0-9\._-]/, '') + result = result.replaceAll(/[^a-z0-9\._-]/g, '') // Remove start and end seperators result = result.replace(/^[-\._]+/, '')