How to use the isHexColor function from validator
Find comprehensive JavaScript validator.isHexColor code examples handpicked from public code repositorys.
22 23 24 25 26 27 28 29 30 31
console.log('YXNkYXNkc2R2YWFzbG5rc2FkbnZsc2EnZHY=\n', 'isBase64', validator.isBase64('YXNkYXNkc2R2YWFzbG5rc2FkbnZsc2EnZHY=')); console.log('asdasdsdvaaslnksadnvlsa"dv\n', 'isBase64', validator.isBase64('asdasdsdvaaslnksadnvlsa"dv')); console.log('ccc\n', 'isHexColor', validator.isHexColor('ccc')); console.log('ggg0000\n', 'isHexColor', validator.isHexColor('ggg0000')); console.log('ccc12312asdafas\n', 'isAlphanumeric', validator.isAlphanumeric('ccc12312asdafas'));
15
3
4
+ 3 other calls in file
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
const validHexa = url => validator.isHexadecimal(url) || validator.isHexColor(url); const validHexadecimal = url => validator.isHexadecimal(url); const validHexaColor = url => validator.isHexColor(url); const validUUID = url => validator.isUUID(url); // unsafe validators
5
63
0
80 81 82 83 84 85 86 87 88 89
} return true; }, isHexColor: function(rule, value) { if (rule) { return validator.isHexColor(value); } return true; }, isLowercase: function(rule, value) {
0
2
2
+ 5 other calls in file
44 45 46 47 48 49 50 51 52 53 54 55 56
} // Validate hexadecimal color exports.validateHexColor = (hexColor) => { return validator.isHexColor(hexColor); } // Validate hexadecimal number
0
0
0
validator.escape is the most popular function in validator (548 examples)