Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/is-ascii-control-char-code
Check if a given value is one of the ASCII control character codes
https://github.com/shinnn/is-ascii-control-char-code
Last synced: 27 days ago
JSON representation
Check if a given value is one of the ASCII control character codes
- Host: GitHub
- URL: https://github.com/shinnn/is-ascii-control-char-code
- Owner: shinnn
- License: 0bsd
- Created: 2016-12-19T12:20:25.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T01:54:54.000Z (over 5 years ago)
- Last Synced: 2024-10-11T14:37:58.301Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://runkit.com/npm/is-ascii-control-char-code
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-ascii-control-char-code
[![npm version](https://img.shields.io/npm/v/is-ascii-control-char-code.svg)](https://www.npmjs.com/package/is-ascii-control-char-code)
[![Build Status](https://travis-ci.com/shinnn/is-ascii-control-char-code.svg?branch=master)](https://travis-ci.com/shinnn/is-ascii-control-char-code)
[![codecov](https://codecov.io/gh/shinnn/is-ascii-control-char-code/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/is-ascii-control-char-code)Check if a given value is one of the ASCII control character codes
```javascript
import isAsciiControlCharCode from 'is-ascii-control-char-code';isAsciiControlCharCode(10); //=> true
isAsciiControlCharCode(100); //=> false
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install is-ascii-control-char-code
```## API
```javascript
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`.
```javascript
// 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](https://github.com/shinnn/is-ascii-control-char) - Check a character instead of a character code
## License
[BSD Zero Clause License](./LICENSE) © 2019 Shinnosuke Watanabe