(obj)
| 37 | return str.split(search).join(replace) |
| 38 | } |
| 39 | objectToEncodedString(obj) { |
| 40 | return Object.keys(obj) |
| 41 | .map(identifierCell => { |
| 42 | const value = obj[identifierCell] |
| 43 | const valueCells = value instanceof Array ? value : [value] |
| 44 | const row = [identifierCell, ...valueCells].map(cell => this.encodeCell(cell)) |
| 45 | return row.join(this.grammar.columnDelimiter) |
| 46 | }) |
| 47 | .join(this.grammar.rowDelimiter) |
| 48 | } |
| 49 | arrayToEncodedString(arr) { |
| 50 | return arr.map(line => line.map(cell => this.encodeCell(cell)).join(this.grammar.columnDelimiter)).join(this.grammar.rowDelimiter) |
| 51 | } |
no test coverage detected