isHexadecimal.js 189 B

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