-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
Describe the bug
A clear and concise description of what the bug is.
unlike other color testing, such as isHSL isRgb does not ignore spaces
Examples
Sample stackblitz
import validator from 'validator';
const testString = 'rgb(204, 0, 102)';
console.log('isRGB with spaces', validator.isRgbColor(testString));
console.log(
'isRGB no spaces',
validator.isRgbColor(testString.replace(/\s/g, ''))
);
console.log('isHSL', validator.isHSL('hsl(300, 100%, 40%)'));Expected output
isRGB with spaces true
isRGB no spaces true
isHSL true
Actual output
isRGB with spaces false
isRGB no spaces true
isHSL true
Additional context
Validator.js version: 13.7
Node.js version: 18
OS platform: [windows, linux, macOS, etc] linux
kamilmielnik