Skip to content

Commit

Permalink
Fix isValid
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jul 8, 2018
1 parent 04fc220 commit d0243b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .size-limit
@@ -1,6 +1,6 @@
[
{
"path": "index.js",
"limit": "931 B"
"limit": "959 B"
}
]
4 changes: 3 additions & 1 deletion lib/is-valid.js
Expand Up @@ -6,7 +6,9 @@ function isShortId(id) {
return false;
}

var nonAlphabetic = new RegExp('[^' + alphabet.characters() + ']+', 'g');
var nonAlphabetic = new RegExp('[^' +
alphabet.characters().replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') +
']+');
return !nonAlphabetic.test(id);
}

Expand Down

0 comments on commit d0243b4

Please sign in to comment.