1 | ;
|
2 | var pkg = require('./pkg');
|
3 | var depsFor = require('./deps-for');
|
4 |
|
5 | /* @private
|
6 | *
|
7 | * @method statPathsFor
|
8 | * @param {String} name
|
9 | * @param
|
10 | * @return {Array} the paths required to stat, to ensure a given module has not changed.
|
11 | */
|
12 | module.exports = function statPathsFor(name, dir) {
|
13 | var thePackage = pkg(name, dir);
|
14 | if (thePackage === null) {
|
15 | // the package was not found, nothing to stat
|
16 | return [];
|
17 | }
|
18 | var paths = depsFor(name, dir).
|
19 | map(function(dep) { return dep.baseDir; }).
|
20 | filter(function(path) { return 0 !== path.indexOf(thePackage.baseDir); });
|
21 |
|
22 | paths.push(thePackage.baseDir);
|
23 |
|
24 | return paths.sort();
|
25 | };
|