From 219ffe6ae36e1aa34d60c11ff4a8370d7474e66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Sat, 10 Sep 2022 08:20:41 +0200 Subject: [PATCH] Remove named capture group (#80) Co-authored-by: Sindre Sorhus --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5746537..30e3ba8 100644 --- a/index.js +++ b/index.js @@ -129,12 +129,12 @@ function assembleStyles() { }, hexToRgb: { value: hex => { - const matches = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16)); + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); if (!matches) { return [0, 0, 0]; } - let {colorString} = matches.groups; + let [colorString] = matches; if (colorString.length === 3) { colorString = [...colorString].map(character => character + character).join('');