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

Method fromDelimited

external/.scrollLibs.js:17652–17656  ·  view source on GitHub ↗
(str, delimiter, quoteChar = '"')

Source from the content-addressed store, hash-verified

17650 return this.fromDelimited(str, "\t", '"')
17651 }
17652 static fromDelimited(str, delimiter, quoteChar = '"') {
17653 str = str.replace(/\r/g, "") // remove windows newlines if present
17654 const rows = this._getEscapedRows(str, delimiter, quoteChar)
17655 return this._rowsToParticle(rows, delimiter, true)
17656 }
17657 static _getEscapedRows(str, delimiter, quoteChar) {
17658 return str.includes(quoteChar) ? this._strToRows(str, delimiter, quoteChar) : str.split("\n").map(line => line.split(delimiter))
17659 }

Callers 3

fromCsvMethod · 0.95
fromSsvMethod · 0.95
fromTsvMethod · 0.95

Calls 3

_getEscapedRowsMethod · 0.95
_rowsToParticleMethod · 0.95
replaceMethod · 0.80

Tested by

no test coverage detected