(header)
| 16338 | return this.toDelimited(",") |
| 16339 | } |
| 16340 | _getTypes(header) { |
| 16341 | const matrix = this._getMatrix(header) |
| 16342 | const types = header.map(i => "int") |
| 16343 | matrix.forEach(row => { |
| 16344 | row.forEach((value, index) => { |
| 16345 | const type = types[index] |
| 16346 | if (type === "string") return 1 |
| 16347 | if (value === undefined || value === "") return 1 |
| 16348 | if (type === "float") { |
| 16349 | if (value.match(/^\-?[0-9]*\.?[0-9]*$/)) return 1 |
| 16350 | types[index] = "string" |
| 16351 | } |
| 16352 | if (value.match(/^\-?[0-9]+$/)) return 1 |
| 16353 | types[index] = "string" |
| 16354 | }) |
| 16355 | }) |
| 16356 | return types |
| 16357 | } |
| 16358 | toDataTable(header = this._getUnionNames()) { |
| 16359 | const types = this._getTypes(header) |
| 16360 | const parsers = { |
no test coverage detected