Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getFullPath: function getFullPath(mountPath, url) {
if (url.indexOf('://')) {
url = urlLib.parse(url).pathname;
}
const base = unescape(url.split('?')[0]);
let fullPath = path.join(mountPath, base);
// converts unix paths to windows path on windows (not sure if this is a good thing)
fullPath = path.normalize(fullPath);
// index.html support
if (path.sep === fullPath[fullPath.length - 1]) {
fullPath += 'index.html';
}
return fullPath;
},
let download_path = parts.reduce((prev, current) => {
let dir = prev + path.sep + current;
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
dir_exists = false;
} else {
dir_exists = true;
}
return dir;
});
// download zip
watcher.on('all', async (event, file) => {
const changedPkg = path.relative(packagesDir, file).split(path.sep)[0];
pendingChangesMap[changedPkg] = true;
await queueTranspile(changedPkg);
pendingChangesMap[changedPkg] = false;
});
});