CoastalCommitsPastes/server/node_modules/validator/es/lib/isHexadecimal.js
2022-03-06 16:46:59 -08:00

6 lines
No EOL
189 B
JavaScript

import assertString from './util/assertString';
var hexadecimal = /^(0x|0h)?[0-9A-F]+$/i;
export default function isHexadecimal(str) {
assertString(str);
return hexadecimal.test(str);
}