* Generates cache for property to and from column addressation.
()
| 155 | * Generates cache for property to and from column addressation. |
| 156 | */ |
| 157 | createMap() { |
| 158 | const schema = this.getSchema(); |
| 159 | |
| 160 | if (typeof schema === 'undefined') { |
| 161 | throwWithCause('trying to create `columns` definition but you didn\'t provide `schema` nor `data`'); |
| 162 | } |
| 163 | |
| 164 | const columns = this.tableMeta.columns; |
| 165 | |
| 166 | this.colToPropCache = []; |
| 167 | this.propToColCache = new Map(); |
| 168 | |
| 169 | if (columns) { |
| 170 | this.#buildColumnCache(columns, schema); |
| 171 | } else { |
| 172 | this.recursiveDuckColumns(schema); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Builds the column property cache from the `columns` setting. |
no test coverage detected