UNPKG

assertthat

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