UNPKG

earljs

Version:

Ergonomic, modern and type-safe assertion library

11 lines (10 loc) 493 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.format = void 0; const FormatOptions_1 = require("./FormatOptions"); const formatUnknown_1 = require("./formatUnknown"); function format(value, sibling, options = FormatOptions_1.DEFAULT_FORMAT_OPTIONS) { const lines = (0, formatUnknown_1.formatUnknown)(value, sibling, options, [], []); return lines.map(([n, str]) => ' '.repeat(n * options.indentSize) + str).join('\n'); } exports.format = format;