From 2d273bf06cab66ba81104eccb912c3eab5fa6ad9 Mon Sep 17 00:00:00 2001 From: Rob van der Linde Date: Tue, 30 Apr 2024 19:35:39 +1200 Subject: [PATCH] Fix escape before comma in regex is redundant There are various other commas in the same regex that aren't escaped. This one doesn't need escaping either. --- js/utils/color.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/utils/color.js b/js/utils/color.js index edf67c4a..e28a2b13 100644 --- a/js/utils/color.js +++ b/js/utils/color.js @@ -44,7 +44,7 @@ export const colorToRgb = ( color ) => { }; } - let rgba = color.match( /^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*([\d]+|[\d]*.[\d]+)\s*\)$/i ); + let rgba = color.match( /^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d]+|[\d]*.[\d]+)\s*\)$/i ); if( rgba ) { return { r: parseInt( rgba[1], 10 ),