dotfiles/vscode/.vscode/extensions/randomfractalsinc.vscode-data-preview-2.3.0/node_modules/command-line-usage/lib/content-section.js
Errol Sancaktar ff17c17e23 vscode
2024-06-14 09:31:58 -06:00

28 lines
701 B
JavaScript

'use strict'
const Section = require('./section')
class ContentSection extends Section {
constructor (section) {
super()
this.header(section.header)
if (section.content) {
/* add content without indentation or wrapping */
if (section.raw) {
const arrayify = require('array-back')
const chalkFormat = require('./chalk-format')
const content = arrayify(section.content).map(line => chalkFormat(line))
this.add(content)
} else {
const Content = require('./content')
const content = new Content(section.content)
this.add(content.lines())
}
this.emptyLine()
}
}
}
module.exports = ContentSection