Skip to content

Commit

Permalink
Update readfiles.js
Browse files Browse the repository at this point in the history
Fix Code scanning alert:
- Title: Useless regular-expression character escape
- File: lib/readfiles.js:21
- Description: The escape sequence '\.' is equivalent to just '.', so the sequence may still represent a meta-character when it is used in a regular expression.
- Tool: CodeQL
- Rule ID: js/useless-regexp-character-escape
  • Loading branch information
ThibaudLopez authored and guatedude2 committed May 18, 2022
1 parent f0a6716 commit 9a174c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/readfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function buildFilter(filters) {
return '[^\\/]*';
})
.replace(/\?/g, '[^\\/]?')
.replace(/\*\*/g, '\.*')
.replace(/\*\*/g, '.*')
.replace(/([\-\+\|])/g, '\\$1')
);
}
Expand Down Expand Up @@ -164,4 +164,4 @@ readfiles.RELATIVE = 0;
readfiles.FULL_PATH = 1;
readfiles.FILENAME = 2;

module.exports = readfiles;
module.exports = readfiles;

0 comments on commit 9a174c2

Please sign in to comment.