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 bb58f3e commit 1e5ef21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/alphabet.js
Expand Up @@ -90,7 +90,12 @@ function lookup(index) {
return alphabetShuffled[index];
}

function get () {
return alphabet
}

module.exports = {
get: get,
characters: characters,
seed: setSeed,
lookup: lookup,
Expand Down
4 changes: 2 additions & 2 deletions lib/is-valid.js
Expand Up @@ -7,8 +7,8 @@ function isShortId(id) {
}

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

Expand Down

0 comments on commit 1e5ef21

Please sign in to comment.