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

Method getData

handsontable/src/dataMap/dataSource.ts:93–105  ·  view source on GitHub ↗

* Get all data. * * Each call returns a fresh shallow clone of the source data so consumers can * safely mutate the returned array without affecting subsequent calls or the * underlying data. The fast path skips the per-cell hook lookups in * `getByRange()` and is taken when no `modif

(toArray = false)

Source from the content-addressed store, hash-verified

91 * @returns {Array}
92 */
93 getData(toArray = false) {
94 if (!this.data?.length) {
95 return this.data;
96 }
97
98 if (!toArray
99 && !this.hot!.hasHook('modifySourceData')
100 && !this.hot!.hasHook('modifyRowData')) {
101 return this.data.map(cloneRow);
102 }
103
104 return this.getByRange(null, null, toArray);
105 }
106
107 /**
108 * Set new data source.

Callers

nothing calls this directly

Calls 3

getByRangeMethod · 0.95
hasHookMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected