Skip to content

Commit a46ab86

Browse files
committed
chore: use correct styling
1 parent df22d5c commit a46ab86

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

Conversions/RgbHslConversion.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
* // result = [193, 66, 28]
1616
*/
1717

18-
const checkRgbFormat = (colorRgb) => colorRgb.every(c => c >= 0 && c <= 255);
18+
const checkRgbFormat = (colorRgb) => colorRgb.every((c) => c >= 0 && c <= 255)
1919

2020
const rgbToHsl = (colorRgb) => {
2121
if (!checkRgbFormat(colorRgb)) {
22-
throw new Error('Input is not a valid RGB color.');
23-
}
22+
throw new Error('Input is not a valid RGB color.')
23+
}
2424

2525
let colorHsl = colorRgb
2626

@@ -82,4 +82,4 @@ const rgbToHsl = (colorRgb) => {
8282
return colorHsl
8383
}
8484

85-
export { rgbToHsl }
85+
export { rgbToHsl }

Conversions/test/RgbHslConversion.test.js

+6-12
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,15 @@ describe('RgbHslConversion', () => {
2929
[255, 255, 255],
3030
[0, 0, 100]
3131
]
32-
])(
33-
'Should return the color in HSL format.',
34-
(colorRgb, expected) => {
35-
expect(rgbToHsl(colorRgb)).toEqual(expected)
36-
}
37-
)
32+
])('Should return the color in HSL format.', (colorRgb, expected) => {
33+
expect(rgbToHsl(colorRgb)).toEqual(expected)
34+
})
3835

3936
test.each([
4037
[[256, 180, 9], 'Input is not a valid RGB color.'],
4138
[[-90, 46, 8], 'Input is not a valid RGB color.'],
4239
[[1, 39, 900], 'Input is not a valid RGB color.']
43-
])(
44-
'Should return the error message.',
45-
(colorRgb, expected) => {
46-
expect(() => rgbToHsl(colorRgb)).toThrowError(expected)
47-
}
48-
)
40+
])('Should return the error message.', (colorRgb, expected) => {
41+
expect(() => rgbToHsl(colorRgb)).toThrowError(expected)
42+
})
4943
})

0 commit comments

Comments
 (0)