Remove all commented to avoid false import matches

This commit is contained in:
oceanapplications 2017-10-29 11:27:54 -04:00 committed by GitHub
parent b89c704eff
commit 5130b5a644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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;