MCPcopy Create free account
hub / github.com/breck7/scroll / toMarkdownTableAdvanced

Method toMarkdownTableAdvanced

external/.scrollLibs.js:16494–16504  ·  view source on GitHub ↗
(columns, formatFn)

Source from the content-addressed store, hash-verified

16492 return this.toMarkdownTableAdvanced(this._getUnionNames(), val => val)
16493 }
16494 toMarkdownTableAdvanced(columns, formatFn) {
16495 const matrix = this._getMatrix(columns)
16496 const empty = columns.map(col => "-")
16497 matrix.unshift(empty)
16498 matrix.unshift(columns)
16499 const lines = matrix.map((row, rowIndex) => {
16500 const formattedValues = row.map((val, colIndex) => formatFn(val, rowIndex, colIndex))
16501 return `|${formattedValues.join("|")}|`
16502 })
16503 return lines.join("\n")
16504 }
16505 get asTsv() {
16506 return this.toDelimited("\t")
16507 }

Callers 1

asMarkdownTableMethod · 0.95

Calls 3

_getMatrixMethod · 0.95
mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected