From 54178ab2786401fdcf13e5330f47e8de2a2ea17c Mon Sep 17 00:00:00 2001 From: Eli Skeggs Date: Tue, 4 Feb 2020 09:18:36 -0800 Subject: [PATCH] fix: comply with no-var rule Automated changes. --- rollup.config.js | 2 +- src/index.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 0f0cc20..1ef9f0f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,6 @@ import babel from 'rollup-plugin-babel'; -var pkg = require('./package.json'); +const pkg = require('./package.json'); export default { entry: 'src/index.js', diff --git a/src/index.js b/src/index.js index 3aab28c..3edea96 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -var supportedOperators = [ +const supportedOperators = [ 'contains', 'does not contain', 'is', @@ -147,15 +147,15 @@ function matchesEnd(regexStr) { } // Copied from https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js -var charsToEscape = ['|', '\\', '{', '}', '(', ')', '[', ']', '^', '$', '+', '*', '?', '.']; +const charsToEscape = ['|', '\\', '{', '}', '(', ')', '[', ']', '^', '$', '+', '*', '?', '.']; function escapeRegex(str) { - var escapedChars = charsToEscape.map((char) => `\\${char}`); + const escapedChars = charsToEscape.map((char) => `\\${char}`); return str.replace(new RegExp(`(${escapedChars.join('|')})`, 'g'), '\\$&'); } function unescapeRegex(regexStr) { - var escapedChars = charsToEscape.map((char) => `\\\\\\${char}`); + const escapedChars = charsToEscape.map((char) => `\\\\\\${char}`); return regexStr.replace(new RegExp(`(${escapedChars.join('|')})`, 'g'), (match) => match.slice(1) );