is-any-letter
v1.1.3
Published
A small module to detect letters by checking if it has a lowercase and uppercase version.
Downloads
6
Maintainers
Readme
is-any-letter
A small module to detect letters by checking if it has a lowercase and uppercase version.
Installation
$ npm install is-any-letter --save
Usage
In this module, a letter is any character that has an uppercase and lowercase version, so some special characters that are only lowercase or uppercase will return false.
const letter = require('is-any-letter')
// tests if a single charcter is a letter
letter.isLetter('A') // true
// tests if a string only contains a letter
letter.onlyLetters('Aβçdéfϱ') // true
Adding allowed symbols or character
It's possible to add any symbol or character to the accepted ones by adding a string with allowed characters as second argument.
letter.isLetter('*', '*_-()') // true
letter.onlyLetters('A-β*ç_d(éf)ϱ', '*_-()') // true
Test
$ npm test