allowedcharacters
v1.0.2
Published
[![Build Status](https://travis-ci.org/markwylde/allowed-characters.svg?branch=master)](https://travis-ci.org/markwylde/allowed-characters) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/markwylde/allowed-characters) [![Git
Downloads
5
Readme
allowed-characters
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"'