mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 09:08:46 +00:00

* install eslint-plugin-markdown * add doc/.eslintrc.yaml * add `<!-- eslint-disable rule -->` or `<!-- eslint-disable -->` for the rest of problematic code * .js files in doc folder added to .eslintignore * update Makefile and vcbuild.bat PR-URL: https://github.com/nodejs/node/pull/12563 Refs: https://github.com/nodejs/node/pull/12557#issuecomment-296015032 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
30 lines
683 B
JavaScript
30 lines
683 B
JavaScript
/**
|
|
* @author Titus Wormer
|
|
* @copyright 2016 Titus Wormer
|
|
* @license MIT
|
|
* @module is-alphabetical
|
|
* @fileoverview Check if a character is alphabetical.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/* eslint-env commonjs */
|
|
|
|
/* Expose. */
|
|
module.exports = alphabetical;
|
|
|
|
/**
|
|
* Check whether the given character code, or the character
|
|
* code at the first character, is alphabetical.
|
|
*
|
|
* @param {string|number} character
|
|
* @return {boolean} - Whether `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 */
|
|
}
|