Commit 8cae659e authored by Norris Oduro's avatar Norris Oduro Committed by Joe Haddad
Browse files

Fix path regex match bug (#3686)

* Fix path regex match bug

* Use the escape-string-regexp package to escape regex characters

* Remove redundant character escape from path

* Add removed escape of backslashes
parent 12120f6f
Showing with 4 additions and 3 deletions
+4 -3
......@@ -8,12 +8,13 @@
'use strict';
const path = require('path');
const escape = require('escape-string-regexp');
module.exports = function ignoredFiles(appSrc) {
return new RegExp(
`^(?!${path
.normalize(appSrc + '/')
.replace(/[\\]+/g, '/')}).+/node_modules/`,
`^(?!${escape(
path.normalize(appSrc + '/').replace(/[\\]+/g, '/')
)}).+/node_modules/`,
'g'
);
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment