Skip to content

Commit

Permalink
fix: security vulnerabilities in npm modules
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkr00t committed Aug 20, 2018
1 parent 36e996f commit 9f555df
Show file tree
Hide file tree
Showing 3 changed files with 1,423 additions and 2,859 deletions.
8 changes: 5 additions & 3 deletions lib/analyze.js
Expand Up @@ -114,7 +114,9 @@ const getLocation = (fullPath /*: string */, name /*: string*/) => {
const getModuleType = (name /*?: string */) =>
!name || name.startsWith("multi ")
? "entry"
: isNodeModules(name) ? "module" : "file";
: isNodeModules(name)
? "module"
: "file";

const flattenChunks = (stats /*: WebpackStats */) /*: Array<WebpackModule> */ =>
stats.chunks && stats.chunks[0].modules
Expand Down Expand Up @@ -300,7 +302,7 @@ const postProcessModules = (
}
});

if (!module.reasons) {
if (!module.reasons.length) {
acc[name] = module;
} else {
module.reasons = module.reasons.filter(
Expand Down Expand Up @@ -350,7 +352,7 @@ module.exports = function analyze(
updateProgressBar({
title,
text: name,
progress: Math.ceil(cur / joinedModulesCount * 100)
progress: Math.ceil((cur / joinedModulesCount) * 100)
});

return {
Expand Down

0 comments on commit 9f555df

Please sign in to comment.