From 82d351ec0e7618088cbdfa4a151bd0a1a05861ab Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 19 Oct 2024 11:07:29 +0100 Subject: [PATCH 1/2] refactor(index): consolidate controlre variables Signed-off-by: Frazer Smith --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 7e6859a..42231e6 100644 --- a/index.js +++ b/index.js @@ -52,8 +52,7 @@ const credentialsLaxRE = new RegExp(`^${BWS}*${authScheme}${BWS}+${token68}${BWS /** * @see https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1 */ -const CTL = '[\x00-\x1F\x7F]' -const controlRE = new RegExp(CTL) +const controlRE = /[\x00-\x1F\x7F]/ /** * RegExp for basic auth user/pass From 9e95edee50fe09399b16e97a6a57ac2ef74f7de7 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 19 Oct 2024 11:10:52 +0100 Subject: [PATCH 2/2] Update index.js Signed-off-by: Frazer Smith --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 42231e6..2f7cc9b 100644 --- a/index.js +++ b/index.js @@ -52,6 +52,7 @@ const credentialsLaxRE = new RegExp(`^${BWS}*${authScheme}${BWS}+${token68}${BWS /** * @see https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1 */ +// eslint-disable-next-line no-control-regex const controlRE = /[\x00-\x1F\x7F]/ /**