is-ascii-control-char
v2.0.0-0
Published
Check if a given value is one of the ASCII control characters
Downloads
8
Maintainers
Readme
is-ascii-control-char
Check if a given value is one of the ASCII control characters
import isAsciiControlChar from 'is-ascii-control-char';
isAsciiControlChar('\n'); //=> true
isAsciiControlChar('a'); //=> false
Installation
npm install is-ascii-control-char
API
import isAsciiControlChar from 'is-ascii-control-char';
isAsciiControlChar(character)
character: string
Return: boolean
It returns true
if the argument is a single-character string
with an ASCII control character, otherwise returns false
.
// Returns `true`
isAsciiControlChar('\t');
isAsciiControlCharCode('\u007f');
// Returns `false`
isAsciiControlCharCode('A');
isAsciiControlCharCode('\t\t');
isAsciiControlCharCode('');
isAsciiControlCharCode(['non-string', 'argument']);
isAsciiControlCharCode();
Related project
is-ascii-control-char-code - Check a character code instead of a character
License
Copyright (c) 2016 - 2019 Shinnosuke Watanabe
Licensed under the MIT License.