mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.5 KiB
61 lines
1.5 KiB
8 years ago
|
# is-alphanumerical [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
|
||
|
|
||
|
<!--lint disable heading-increment list-item-spacing-->
|
||
|
|
||
|
Check if a character is alphanumerical (`[a-zA-Z0-9]`).
|
||
|
|
||
|
## Installation
|
||
|
|
||
|
[npm][npm-install]:
|
||
|
|
||
|
```bash
|
||
|
npm install is-alphanumerical
|
||
|
```
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
```javascript
|
||
|
var alphanumerical = require('is-alphanumerical');
|
||
|
|
||
|
alphanumerical('a'); // true
|
||
|
alphanumerical('Z'); // true
|
||
|
alphanumerical('0'); // true
|
||
|
alphanumerical(' '); // false
|
||
|
alphanumerical('💩'); // false
|
||
|
```
|
||
|
|
||
|
## API
|
||
|
|
||
|
### `alphanumerical(character)`
|
||
|
|
||
|
Check whether the given character code (`number`), or the character
|
||
|
code at the first position (`string`), is alphanumerical.
|
||
|
|
||
|
## Related
|
||
|
|
||
|
* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical)
|
||
|
* [`is-decimal`](https://github.com/wooorm/is-decimal)
|
||
|
* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)
|
||
|
* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character)
|
||
|
* [`is-word-character`](https://github.com/wooorm/is-word-character)
|
||
|
|
||
|
## License
|
||
|
|
||
|
[MIT][license] © [Titus Wormer][author]
|
||
|
|
||
|
<!-- Definitions -->
|
||
|
|
||
|
[travis-badge]: https://img.shields.io/travis/wooorm/is-alphanumerical.svg
|
||
|
|
||
|
[travis]: https://travis-ci.org/wooorm/is-alphanumerical
|
||
|
|
||
|
[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphanumerical.svg
|
||
|
|
||
|
[codecov]: https://codecov.io/github/wooorm/is-alphanumerical
|
||
|
|
||
|
[npm-install]: https://docs.npmjs.com/cli/install
|
||
|
|
||
|
[license]: LICENSE
|
||
|
|
||
|
[author]: http://wooorm.com
|