assertthat
Version:
assertthat provides fluent TDD.
23 lines (22 loc) • 793 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.prepareChange = void 0;
const chalk_1 = __importDefault(require("chalk"));
const maximumFormattingDepth_1 = require("../../constants/maximumFormattingDepth");
const prepareChange = function (content, depth) {
return `${content}`.
split('\n').
map((line, index) => {
if (depth >= maximumFormattingDepth_1.maximumFormattingDepth) {
return line;
}
if (index !== 0) {
return ` ${line}`;
}
return `${chalk_1.default.yellow('* ')}${line}`;
});
};
exports.prepareChange = prepareChange;