npm

is-ascii-control-char

2.0.0-0 • Public • Published

is-ascii-control-char

npm version Build Status codecov

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

Use npm.

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.

Package Sidebar

Install

npm i is-ascii-control-char

Weekly Downloads

2

Version

2.0.0-0

License

MIT

Unpacked Size

4.6 kB

Total Files

5

Last publish

Collaborators

  • shinnn