Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = async input => {
if (typeof input !== 'string') {
throw new TypeError(`Expected a string, got ${typeof input}`);
}
const spinner = ora('Finding ways to free up space... 0%');
spinner.start();
const sizes = await pProgress
.all(
strategies.map(strategy => {
return strategy.probe();
})
)
.onProgress(progress => {
spinner.text = `Finding ways to free up space... ${percentage(progress)}`;
});
spinner.stop();
const probeSorted = sortBy(
zip(strategies, sizes).map(([strategy, size]) => ({
strategy,
size
})),
p => 0 - p.size
);