|
|
@ -29,8 +29,10 @@ export class SlitherClient extends PluginClient { |
|
|
|
const localNpmDepsPath = `${this.currentSharedFolder}/node_modules` |
|
|
|
const localNpmDepsPath = `${this.currentSharedFolder}/node_modules` |
|
|
|
const npmDepsExists = existsSync(remixNpmDepsPath) |
|
|
|
const npmDepsExists = existsSync(remixNpmDepsPath) |
|
|
|
const nodeModulesExists = existsSync(localNpmDepsPath) |
|
|
|
const nodeModulesExists = existsSync(localNpmDepsPath) |
|
|
|
let isLocalDep = false, isRemixDep = false |
|
|
|
let isLocalDep = false |
|
|
|
let allowPathString = '', remapString = '' |
|
|
|
let isRemixDep = false |
|
|
|
|
|
|
|
let allowPathString = '' |
|
|
|
|
|
|
|
let remapString = '' |
|
|
|
|
|
|
|
|
|
|
|
for (const e of list) { |
|
|
|
for (const e of list) { |
|
|
|
const importPath = e.replace(/import ['"]/g, '').trim() |
|
|
|
const importPath = e.replace(/import ['"]/g, '').trim() |
|
|
@ -112,7 +114,7 @@ export class SlitherClient extends PluginClient { |
|
|
|
const outputFile: string = 'remix-slitherReport_' + Date.now() + '.json' |
|
|
|
const outputFile: string = 'remix-slitherReport_' + Date.now() + '.json' |
|
|
|
const fileContent = readFileSync(`${this.currentSharedFolder}/${filePath}`, 'utf8') |
|
|
|
const fileContent = readFileSync(`${this.currentSharedFolder}/${filePath}`, 'utf8') |
|
|
|
const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) |
|
|
|
const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) |
|
|
|
let allowPaths = '', remaps = '' |
|
|
|
let allowPaths = ''; let remaps = '' |
|
|
|
if (importsArr?.length) { |
|
|
|
if (importsArr?.length) { |
|
|
|
const { remapString, allowPathString } = this.mapNpmDepsDir(importsArr) |
|
|
|
const { remapString, allowPathString } = this.mapNpmDepsDir(importsArr) |
|
|
|
allowPaths = allowPathString |
|
|
|
allowPaths = allowPathString |
|
|
|