(columnNames, atomFn)
| 16384 | return matrix |
| 16385 | } |
| 16386 | _toArrays(columnNames, atomFn) { |
| 16387 | const skipHeaderRow = 1 |
| 16388 | const header = columnNames.map((columnName, index) => atomFn(columnName, 0, index)) |
| 16389 | const rows = this.map((particle, rowNumber) => |
| 16390 | columnNames.map((columnName, columnIndex) => { |
| 16391 | const subparticleParticle = particle.getParticle(columnName) |
| 16392 | const content = subparticleParticle ? subparticleParticle.contentWithSubparticles : "" |
| 16393 | return atomFn(content, rowNumber + skipHeaderRow, columnIndex) |
| 16394 | }) |
| 16395 | ) |
| 16396 | return { |
| 16397 | rows, |
| 16398 | header |
| 16399 | } |
| 16400 | } |
| 16401 | _toDelimited(delimiter, header, atomFn) { |
| 16402 | const data = this._toArrays(header, atomFn) |
| 16403 | return data.header.join(delimiter) + "\n" + data.rows.map(row => row.join(delimiter)).join("\n") |
no test coverage detected