Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function getDirectories(p: string): Promise {
const contents = await readdir(p);
return filter(contents.map(f => path.resolve(p, f)), async f => (await stat(f)).isDirectory());
}
async getGlobalOptions(): Promise {
const visibleOptions = await filter(GLOBAL_OPTIONS, async opt => isOptionVisible(opt));
return visibleOptions.map(opt => formatOptionName(opt, { colors: NO_COLORS, showAliases: false }));
}
export async function getPlatforms(projectDir: string): Promise {
const platformsDir = path.resolve(projectDir, 'platforms');
const contents = await readdirSafe(platformsDir);
const platforms = await filter(contents, async file => {
const stat = await statSafe(path.join(platformsDir, file));
return !file.startsWith('.') && typeof stat !== 'undefined' && stat.isDirectory();
});
return platforms;
}