summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/is-alphanumerical/index.js
blob: 58ea455baa4efe36efb91922387822a6100f2c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * @author Titus Wormer
 * @copyright 2016 Titus Wormer
 * @license MIT
 * @module is-alphanumerical
 * @fileoverview Check if a character is alphanumerical.
 */

'use strict';

/* eslint-env commonjs */

/* Dependencies. */
var alphabetical = require('is-alphabetical');
var decimal = require('is-decimal');

/* Expose. */
module.exports = alphanumerical;

/**
 * Check whether the given character code, or the character
 * code at the first character, is alphanumerical.
 *
 * @param {string|number} character
 * @return {boolean} - Whether `character` is alphanumerical.
 */
function alphanumerical(character) {
  return alphabetical(character) || decimal(character);
}