Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
path.split(PATH_SEPARATOR).forEach(function(name) {
if (!name || name.substr(-1, 1) == ":") return;
resolvedPath += PATH_SEPARATOR + name;
var stat;
try {
stat = fs.statSync(resolvedPath);
} catch (e) {
fs.mkdirSync(resolvedPath);
}
if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath);
});
}