is-ascii-control-char-code
v2.0.0
Published
Check if a given value is one of the ASCII control character codes
Downloads
11
Maintainers
Readme
is-ascii-control-char-code
Check if a given value is one of the ASCII control character codes
import isAsciiControlCharCode from 'is-ascii-control-char-code';
isAsciiControlCharCode(10); //=> true
isAsciiControlCharCode(100); //=> false
Installation
npm install is-ascii-control-char-code
API
import isAsciiControlCharCode from 'is-ascii-control-char-code';
isAsciiControlCharCode(charCode)
charCode: number
Return: boolean
It returns true
if the argument is a whole number no fewer than 0
and no greater than 31
, or 127
. Otherwise, it returns false
.
// Returns `true`
isAsciiControlCharCode(0);
isAsciiControlCharCode(31);
isAsciiControlCharCode(127);
// Returns `false`
isAsciiControlCharCode(-1);
isAsciiControlCharCode(32);
isAsciiControlCharCode(0.5);
isAsciiControlCharCode(NaN);
isAsciiControlCharCode(Infinity);
isAsciiControlCharCode('non-number argument');
isAsciiControlCharCode();
Related
- is-ascii-control-char - Check a character instead of a character code
License
BSD Zero Clause License © 2019 Shinnosuke Watanabe