summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/is-alphabetical/index.js
blob: 3b27588720441bc1ec2a3d77d1e5f01fe23a1dc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';

module.exports = alphabetical;

/* Check if the given character code, or the character
 * code at the first character, is alphabetical. */
function alphabetical(character) {
  var code = typeof character === 'string' ?
    character.charCodeAt(0) : character;

  return (code >= 97 && code <= 122) || /* a-z */
    (code >= 65 && code <= 90); /* A-Z */
}