mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-15 09:54:11 +03:00
Fix normalizeColor
function (#10713)
This commit is contained in:
parent
82e1375fc6
commit
e9a3ab729e
6
sdk.mjs
6
sdk.mjs
@ -175,10 +175,8 @@ export const normalizeNewlines = (text) => {
|
||||
export const normalizeColor = (text) => {
|
||||
let color = text.replace('#', '').toUpperCase();
|
||||
if (color.length < 6) {
|
||||
color = color
|
||||
.slice(0, 3)
|
||||
.map((x) => x.repeat(2))
|
||||
.join('');
|
||||
// eslint-disable-next-line unicorn/no-useless-spread
|
||||
color = [...color.slice(0, 3)].map((x) => x.repeat(2)).join('');
|
||||
} else if (color.length > 6) {
|
||||
color = color.slice(0, 6);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user