1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-03 21:00:04 +02:00

update dependencies

This commit is contained in:
s2
2018-10-09 09:51:34 +02:00
parent 4fcc873901
commit da4083f574
1112 changed files with 23205 additions and 21697 deletions

View File

@@ -56,10 +56,16 @@ class Pruner {
}
}
function isNodeModuleFolder (pathToCheck) {
return path.basename(path.dirname(pathToCheck)) === 'node_modules' ||
// TODO: Change to startsWith in Node 6
(path.basename(path.dirname(pathToCheck))[0] === '@' && path.basename(path.resolve(pathToCheck, `..${path.sep}..`)) === 'node_modules')
}
module.exports = {
isModule: function isModule (pathToCheck) {
return fs.pathExists(path.join(pathToCheck, 'package.json'))
.then(exists => exists && path.basename(path.dirname(pathToCheck)) === 'node_modules')
.then(exists => exists && isNodeModuleFolder(pathToCheck))
},
Pruner: Pruner
}