From de43e57f411c17b990b3d48f1bc120686fb66afe Mon Sep 17 00:00:00 2001 From: Ayoub-Mabrouk Date: Fri, 8 Nov 2024 22:58:18 +0100 Subject: [PATCH] Refactor CACHE_CONTROL_NO_CACHE_REGEXP to simplify pattern and improve readability The regular expression was simplified by directly looking for the 'no-cache' keyword with word boundaries, removing unnecessary checks for commas and string edges. This improves the clarity of the code and makes the regex easier to understand and maintain. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fc3dea7..756295c 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ * @private */ -var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/ +var CACHE_CONTROL_NO_CACHE_REGEXP = /\bno-cache\b/ /** * Module exports.