(rows, hasHeaders)
| 17823 | return result |
| 17824 | } |
| 17825 | static _getHeader(rows, hasHeaders) { |
| 17826 | const numberOfColumns = rows[0].length |
| 17827 | const headerRow = hasHeaders ? rows[0] : [] |
| 17828 | const AtomBreakSymbol = " " |
| 17829 | const ziRegex = new RegExp(AtomBreakSymbol, "g") |
| 17830 | if (hasHeaders) { |
| 17831 | // Strip any AtomBreakSymbols from column names in the header row. |
| 17832 | // This makes the mapping not quite 1 to 1 if there are any AtomBreakSymbols in names. |
| 17833 | for (let index = 0; index < numberOfColumns; index++) { |
| 17834 | headerRow[index] = headerRow[index].replace(ziRegex, "") |
| 17835 | } |
| 17836 | } else { |
| 17837 | // If str has no headers, create them as 0,1,2,3 |
| 17838 | for (let index = 0; index < numberOfColumns; index++) { |
| 17839 | headerRow.push(index.toString()) |
| 17840 | } |
| 17841 | } |
| 17842 | return headerRow |
| 17843 | } |
| 17844 | static nest(str, xValue) { |
| 17845 | const ParticleBreakSymbol = PARTICLE_MEMBRANE |
| 17846 | const AtomBreakSymbol = ATOM_MEMBRANE |
no test coverage detected