UNPKG

assertthat

Version:
23 lines (22 loc) 835 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareAddition = void 0; const chalk_1 = __importDefault(require("chalk")); const maximumFormattingDepth_1 = require("../../constants/maximumFormattingDepth"); const prepareAddition = function (content, depth) { return `${content}`. split('\n'). map((line, index) => { if (depth >= maximumFormattingDepth_1.maximumFormattingDepth) { return chalk_1.default.red(line); } if (index !== 0) { return chalk_1.default.red(` ${line}`); } return chalk_1.default.red(`- ${line}`); }); }; exports.prepareAddition = prepareAddition;