1.0.2 • Published 4 years ago

allowedcharacters v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

allowed-characters

Build Status GitHub code size in bytes GitHub package.json version GitHub js-semistandard-style

Throw an error if a string contains unallowed characters

Installation

npm i --save allowedcharacters

Usage

allowedCharacters -> allowed -> string -> string|error

1. Correct characters

allowedCharacters('123', '123') === '123';

2. Incorrect characters

allowedCharacters('123', '1234')
// throws error: 'contained unallowed character "4"'
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago