Skip to content

Commit

Permalink
Merge pull request #807 from qawolf/improve-is-dynamic
Browse files Browse the repository at this point in the history
fix: make isDynamic more strict by removing alphabet from word list
  • Loading branch information
jperl committed Aug 31, 2020
2 parents d4c49cf + aa0ed87 commit 949d755
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/web/isDynamic.ts
Expand Up @@ -33,6 +33,9 @@ const allWords = new Set([
...englishWords,
]);

// remove the alphabet from word list
for (let i = 0; i < 26; i++) allWords.delete((i + 10).toString(36));

const SCORE_THRESHOLD = 0.5;

export const getTokens = (value: string): string[] => {
Expand Down
1 change: 1 addition & 0 deletions test/web/isDynamic.test.ts
Expand Up @@ -7,6 +7,7 @@ describe('isDynamic', () => {
'gb_C',
'ggWlfB2BMlWvNeAo2F0uqw',
'gLFyf',
'haSfzA',
'intercom-123v9c3',
'StyledBox-sc-13pk1d4-0',
'StyledLayer-rmtehz-0',
Expand Down

0 comments on commit 949d755

Please sign in to comment.