index.js 428 B

123456789101112131415
  1. 'use strict'
  2. module.exports = hexadecimal
  3. // Check if the given character code, or the character code at the first
  4. // character, is hexadecimal.
  5. function hexadecimal(character) {
  6. var code = typeof character === 'string' ? character.charCodeAt(0) : character
  7. return (
  8. (code >= 97 /* a */ && code <= 102) /* z */ ||
  9. (code >= 65 /* A */ && code <= 70) /* Z */ ||
  10. (code >= 48 /* A */ && code <= 57) /* Z */
  11. )
  12. }