lib/ascii.js
function isTokenChar(code) {
  return code === 0x21                // '!'
    || code >= 0x23 && code <= 0x27   // '#', '$', '%', '&', '''
    || code === 0x2A                  // '*'
    || code === 0x2B                  // '+'
    || code === 0x2D                  // '-'
    || code === 0x2E                  // '.'
    || code >= 0x30 && code <= 0x39   // 0-9
    || code >= 0x41 && code <= 0x5A   // A-Z
    || code >= 0x5E && code <= 0x7A   // '^', '_', '`', a-z
    || code === 0x7C                  // '|'
    || code === 0x7E;                 // '~'
}
function isTokenChar(code) {
  return code === 0x21                // '!'
    || code >= 0x23 && code <= 0x27   // '#', '$', '%', '&', '''
    || code === 0x2A                  // '*'
    || code === 0x2B                  // '+'
    || code === 0x2D                  // '-'
    || code === 0x2E                  // '.'
    || code >= 0x30 && code <= 0x39   // 0-9
    || code >= 0x41 && code <= 0x5A   // A-Z
    || code >= 0x5E && code <= 0x7A   // '^', '_', '`', a-z
    || code === 0x7C                  // '|'
    || code === 0x7E;                 // '~'
}
function isTokenChar ( code ) { return code === 0x21 // '!' || code >= 0x23 && code <= 0x27 // '#', '$', '%', '&', ''' || code === 0x2A // '*' || code === 0x2B // '+' || code === 0x2D // '-' || code === 0x2E // '.' || code >= 0x30 && code <= 0x39 // 0-9 || code >= 0x41 && code <= 0x5A // A-Z || code >= 0x5E && code <= 0x7A // '^', '_', '`', a-z || code === 0x7C // '|' || code === 0x7E ; // '~' }
Check if a character is allowed in a token as defined in section 3.2.6
of RFC 7230.

@param {number} code The code of the character to check.
@returns {boolean} `true` if the character is allowed, else `false`.
@public
Check if a character is allowed in a token as defined in section 3 . 2 . 6 of RFC 7230 .