Skip to content
Permalink
Browse files

style: fix errors after upgrading to `eslint-config-airbnb-base@v14`

  • Loading branch information
probil committed Aug 22, 2019
1 parent f05cbc4 commit 6ad8b6e8d2bbb617b8cd56a80123c7b383c5fcdc
Showing with 7 additions and 7 deletions.
  1. +1 −1 src/utils/index.js
  2. +6 −6 src/utils/regexp.js
@@ -16,7 +16,7 @@ export const trigger = (el, type) => {
* @param {HTMLElement} el
* @returns {HTMLElement|HTMLInputElement}
*/
export const queryInputElementInside = el => (
export const queryInputElementInside = (el) => (
el instanceof HTMLInputElement
? el
: el.querySelector('input') || el
@@ -19,12 +19,12 @@ const stringToRegexp = (str) => {
* @param {RegExp} charRegexp
* @return {RegExp}
*/
export const makeRegexpOptional = charRegexp => (
export const makeRegexpOptional = (charRegexp) => (
stringToRegexp(
charRegexp.toString()
.replace(
/.(\/)[gmiyus]{0,6}$/,
match => match.replace('/', '?/'),
(match) => match.replace('/', '?/'),
),
)
);
@@ -33,7 +33,7 @@ export const makeRegexpOptional = charRegexp => (
* @param {String} char
* @return {String}
*/
const escapeIfNeeded = char => (
const escapeIfNeeded = (char) => (
'[\\^$.|?*+()'.indexOf(char) > -1
? `\\${char}`
: char
@@ -44,17 +44,17 @@ const escapeIfNeeded = char => (
* @param {String} char
* @return {RegExp}
*/
const charRegexp = char => new RegExp(`/[${escapeIfNeeded(char)}]/`);
const charRegexp = (char) => new RegExp(`/[${escapeIfNeeded(char)}]/`);

/**
* Determines if value is regular expression
* @param {String|RegExp} entity
* @return {boolean}
*/
const isRegexp = entity => entity instanceof RegExp;
const isRegexp = (entity) => entity instanceof RegExp;

/**
* @param {String|RegExp} char
* @return {RegExp}
*/
export const castToRegexp = char => (isRegexp(char) ? char : charRegexp(char));
export const castToRegexp = (char) => (isRegexp(char) ? char : charRegexp(char));

0 comments on commit 6ad8b6e

Please sign in to comment.
You can’t perform that action at this time.