assertthat
Version:
assertthat provides fluent TDD.
24 lines (20 loc) • 510 B
text/typescript
import chalk from 'chalk';
import { maximumFormattingDepth } from '../../constants/maximumFormattingDepth';
const prepareChange = function (content: string, depth: number): string [] {
return `${content}`.
split('\n').
map(
(line, index): string => {
if (depth >= maximumFormattingDepth) {
return line;
}
if (index !== 0) {
return ` ${line}`;
}
return `${chalk.yellow('* ')}${line}`;
}
);
};
export {
prepareChange
};