| 53 | return this.uriEncodedString.split(this.grammar.rowDelimiter).map(line => line.split(this.grammar.columnDelimiter).map(cell => this.decodeCell(cell))) |
| 54 | } |
| 55 | get object() { |
| 56 | const patchObj = {} |
| 57 | if (!this.uriEncodedString) return patchObj |
| 58 | this.array.forEach(cells => { |
| 59 | const identifierCell = cells.shift() |
| 60 | patchObj[identifierCell] = cells.length > 1 ? cells : cells[0] // If a single value, collapse to a simple tuple. todo: sure about this design? |
| 61 | }) |
| 62 | return patchObj |
| 63 | } |
| 64 | encodeCell(unencodedCell) { |
| 65 | return this.encoders.reduce((str, encoder) => encoder.encode(str), unencodedCell) |
| 66 | } |