diff --git a/package.json b/package.json index 938e395..fa30525 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "email": "zurisadai.pabon@gmail.com" }, "name": "rae", - "version": "1.0.0", + "version": "1.0.1", "description": "Simple Rae Dictionary Library", "keywords": [ "dictionary", diff --git a/src/cli/utils.js b/src/cli/utils.js index cff2a55..4b349e3 100644 --- a/src/cli/utils.js +++ b/src/cli/utils.js @@ -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'; diff --git a/src/helpers/utils.js b/src/helpers/utils.js index bcffee0..38a86cb 100644 --- a/src/helpers/utils.js +++ b/src/helpers/utils.js @@ -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);