Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/is-ascii-control-char
Check if a given value is one of the ASCII control characters
https://github.com/shinnn/is-ascii-control-char
Last synced: 27 days ago
JSON representation
Check if a given value is one of the ASCII control characters
- Host: GitHub
- URL: https://github.com/shinnn/is-ascii-control-char
- Owner: shinnn
- License: mit
- Created: 2016-12-19T13:10:25.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-10T17:30:51.000Z (over 5 years ago)
- Last Synced: 2024-04-14T01:16:46.271Z (7 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-ascii-control-char
[![npm version](https://img.shields.io/npm/v/is-ascii-control-char.svg)](https://www.npmjs.com/package/is-ascii-control-char)
[![Build Status](https://travis-ci.com/shinnn/is-ascii-control-char.svg?branch=master)](https://travis-ci.com/shinnn/is-ascii-control-char)
[![codecov](https://codecov.io/gh/shinnn/is-changelog-path/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/is-changelog-path)Check if a given value is one of the ASCII control characters
```javascript
import isAsciiControlChar from 'is-ascii-control-char';isAsciiControlChar('\n'); //=> true
isAsciiControlChar('a'); //=> false
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install is-ascii-control-char
```## API
```javascript
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`.
```javascript
// 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](https://github.com/shinnn/is-ascii-control-char-code) - Check a character code instead of a character
## License
Copyright (c) 2016 - 2019 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).