Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return errors.reduce((acc, text): string[] => {
const [error, ...lines] = text.split(Terminal.EOL);
const title = Theme.join(
Wrapper.SPACE,
this.symbol(IndicationType.Message),
this.symbol(type),
error.trim()
);
return acc.concat([
Theme.indent(level + 1, this.paint(title, type)),
...lines.map((line): string => Theme.indent(sublevel, this.paint(line.trim(), IndicationType.Dim))),
]);
}, []);
}