Skip to content

Commit

Permalink
fix(matcher): include tilde and ñ
Browse files Browse the repository at this point in the history
  • Loading branch information
tsur committed Dec 31, 2018
1 parent be29512 commit 1838664
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"email": "[email protected]"
},
"name": "rae",
"version": "1.0.0",
"version": "1.0.1",
"description": "Simple Rae Dictionary Library",
"keywords": [
"dictionary",
Expand Down
3 changes: 2 additions & 1 deletion src/cli/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isEmpty, keys } from 'lodash';
import isEmpty from 'lodash/isEmpty';
import keys from 'lodash/keys';
import Readline from 'readline';
import minimist from 'minimist';
import RaeClient from 'lib';
Expand Down
6 changes: 4 additions & 2 deletions src/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { isString, isEmpty } from 'lodash';
import isEmpty from 'lodash/isEmpty';
import isString from 'lodash/isString';

const wordRegex = /^[a-z]+$/i;
// i flag is not effective on non-US-ASCII characters, so we need to add the upper cases
const wordRegex = /^(?:[aeiouAEIOU]\u0341|[uU]\u0308|[nN]\u0303|[a-zA-ZáéíóúüÁÉÍÓÚÜñÑ])+$/;

export const isAWord = (word) => isString(word) && !isEmpty(word) && wordRegex.test(word);

Expand Down

0 comments on commit 1838664

Please sign in to comment.