Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const globs = await Promise.all([].concat(input).map(async x => {
const isDirectory = await pathType.isDirectory(getPath(x, options.cwd));
return isDirectory ? getGlob(x, options) : x;
}));
async function getDirectory(filepath: string): Promise {
const filePathIsDirectory = await isDirectory(filepath);
if (filePathIsDirectory === true) {
return filepath;
}
const directory = path.dirname(filepath);
return directory;
}