chore: lint

This commit is contained in:
coderaiser 2023-05-12 17:32:57 +03:00
parent bd7dfd0c28
commit d0e5fc0cbd
4 changed files with 26 additions and 23 deletions

View file

@ -15,10 +15,10 @@ module.exports.escapeRegExp = (str) => {
* get regexp from wild card
*/
module.exports.getRegExp = (wildcard) => {
const escaped = '^' + wildcard // search from start of line
const escaped = `^${wildcard // search from start of line
.replace(/\./g, '\\.')
.replace(/\*/g, '.*')
.replace('?', '.?') + '$'; // search to end of line
.replace('?', '.?')}$`; // search to end of line
return RegExp(escaped);
};