Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return When.promise(function(resolve, reject) {
profile = Path.normalize(profile);
if (!Path.isAbsolute(profile)) {
profile = Path.join(process.cwd(), profile);
}
Fs.stat(profile).then(function(stat) {
if (!stat.isDirectory()) {
reject("Profile path '" + profile + "' is not a directory");
return;
}
resolve(profile);
}).catch(reject);
});
}
var promises = files.map(function (file) {
var fullPath = path.join(dirPath, file);
return FsPromise.stat(fullPath).then(function (stat) {
if (stat.isDirectory()) {
dirs.push(fullPath);
}
});
});
return Q.all(promises).thenResolve(dirs);
.filter(entry => {
if (entry.startsWith('.')) {
return false;
}
const subdirPath = path.join(srcPath, entry);
return fs.stat(subdirPath)
.then(stat => {
return stat.isDirectory();
})
.catch(() => {
return false;
});
})
.map(entry => path.join(srcPath, entry));
function verifyInputs() {
return fsp.stat(packagePath)
.then(function(stats) {
if (!stats.isDirectory()) {
throw new Error(packagePath + " is not a directory");
}
});
}
.then(files => Promise.all(files.map(file => fs.stat(file).then(stat => {
stat.path = file
return stat
}))))
.then(stats => stats.map(stat => {