UNPKG

vils

Version:

Recursively outputs file paths and contents in various formats

17 lines (16 loc) 556 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MarkdownFormatter = void 0; class MarkdownFormatter { format(entries) { return entries.map(e => { if (typeof e.content === 'string') { return `# ${e.relativePath}\n\n\`\`\`\n${e.content}\n\`\`\``; } else { return `# ${e.relativePath}\n\n\`\`\`\n<vils unable to read: ${e.content.error}>\n\`\`\``; } }).join('\n\n'); } } exports.MarkdownFormatter = MarkdownFormatter;