Skip to content

Commit

Permalink
Fix escape before comma in regex is redundant
Browse files Browse the repository at this point in the history
There are various other commas in the same regex that aren't escaped.

This one doesn't need escaping either.
  • Loading branch information
robvdl committed Apr 30, 2024
1 parent 6b8c64f commit 2d273bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/utils/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand Down

0 comments on commit 2d273bf

Please sign in to comment.