Remove all commented to avoid false import matches
This commit is contained in:
parent
b89c704eff
commit
5130b5a644
|
@ -3,6 +3,9 @@ const path = require('path');
|
|||
const findFile = require("./find-file.js");
|
||||
|
||||
function findAllImportPaths(dir, content, cb) {
|
||||
//strip comments from content
|
||||
let commentRegex = new RegExp("\/\/.*", "gi")
|
||||
content = content.replace(commentRegex, '');
|
||||
const subStr = "import ";
|
||||
let allImports = [];
|
||||
let regex = new RegExp(subStr,"gi");
|
||||
|
@ -58,4 +61,4 @@ function getContractName(fileContent) {
|
|||
return fileContent.substring((fileContent.indexOf("contract ") + ("contract ").length), fileContent.indexOf("{")).replace(/\s/g,'')
|
||||
}
|
||||
|
||||
module.exports = findAllImportPaths;
|
||||
module.exports = findAllImportPaths;
|
||||
|
|
Loading…
Reference in New Issue