src/utils/index.js
function allImportPaths(contractSource) {
  const noCommentSource = strip.js(String(contractSource));
  const rawImportStatements = execall(/^(\s*)((import)(.*?))("|')(.*?)("|')((;)|((.*?)(;)))$/gm, noCommentSource);
  const importPaths = rawImportStatements
    .map(v => String(execall(/("|')(.*?)("|')/g, v.match)[0].match)
        .replace(/'/g, '')
        .replace(/"/g, '')
        .replace(/^\//, '')
        .replace('./', '')
        .trim());

  return importPaths.filter(path => (path !== 'wafr/Test.sol'));
}
function allImportPaths(contractSource) {
  const noCommentSource = strip.js(String(contractSource));
  const rawImportStatements = execall(/^(\s*)((import)(.*?))("|')(.*?)("|')((;)|((.*?)(;)))$/gm, noCommentSource);
  const importPaths = rawImportStatements
    .map(v => String(execall(/("|')(.*?)("|')/g, v.match)[0].match)
        .replace(/'/g, '')
        .replace(/"/g, '')
        .replace(/^\//, '')
        .replace('./', '')
        .trim());

  return importPaths.filter(path => (path !== 'wafr/Test.sol'));
}
function allImportPaths ( contractSource ) { const noCommentSource = strip . js ( String ( contractSource ) ) ; const rawImportStatements = execall ( / ^(\s*)((import)(.*?))("|')(.*?)("|')((;)|((.*?)(;)))$ / gm , noCommentSource ) ; const importPaths = rawImportStatements . map ( v => String ( execall ( / ("|')(.*?)("|') / g , v . match ) [ 0 ] . match ) . replace ( / ' / g , '' ) . replace ( / " / g , '' ) . replace ( / ^\/ / , '' ) . replace ( './' , '' ) . trim ( ) ) ; return importPaths . filter ( path => ( path !== 'wafr/Test.sol' ) ) ; }
get all import paths from contract source
get all import paths from contract source