dependency-cruiser-fork
Version:
Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.
11 lines (8 loc) • 355 B
JavaScript
const indentString = require("indent-string");
const wrapAnsi = require("wrap-ansi");
const DEFAULT_INDENT = 4;
module.exports = function wrapAndIndent(pString, pIndent = DEFAULT_INDENT) {
const DOGMATIC_MAX_CONSOLE_WIDTH = 78;
const MAX_WIDTH = DOGMATIC_MAX_CONSOLE_WIDTH - pIndent;
return indentString(wrapAnsi(pString, MAX_WIDTH), pIndent);
};