Skip to content

Commit

Permalink
Merge pull request #649 from chyzwar/patch-3
Browse files Browse the repository at this point in the history
Update assertString.js
  • Loading branch information
chriso authored Jun 22, 2017
2 parents fb2ae42 + 520bf19 commit e3518ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/util/assertString.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export default function assertString(input) {
if (typeof input !== 'string') {
const isString = (typeof input === 'string' || input instanceof String);

if (!isString) {
throw new TypeError('This library (validator.js) validates strings only');
}
}

0 comments on commit e3518ce

Please sign in to comment.