MCPcopy Create free account
hub / github.com/handsontable/handsontable / createMap

Method createMap

handsontable/src/dataMap/dataMap.ts:157–174  ·  view source on GitHub ↗

* Generates cache for property to and from column addressation.

()

Source from the content-addressed store, hash-verified

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.

Callers 2

constructorMethod · 0.95
CoreFunction · 0.80

Calls 4

getSchemaMethod · 0.95
#buildColumnCacheMethod · 0.95
recursiveDuckColumnsMethod · 0.95
throwWithCauseFunction · 0.90

Tested by

no test coverage detected