MCPcopy Index your code
hub / github.com/json-editor/json-editor / empty

Method empty

src/editors/array.js:282–301  ·  view source on GitHub ↗
(hard)

Source from the content-addressed store, hash-verified

280 }
281
282 empty (hard) {
283 if (this.rows === null) return
284
285 this.rows.forEach((row, i) => {
286 if (hard) {
287 if (this.checkParent(row.tab)) row.tab.parentNode.removeChild(row.tab)
288 this.destroyRow(row, true)
289 this.row_cache[i] = null
290 }
291 this.rows[i] = null
292 })
293 if (hard) {
294 for (let j = this.rows.length; j < this.row_cache.length; j++) {
295 this.destroyRow(this.row_cache[j], true)
296 this.row_cache[j] = null
297 }
298 }
299 this.rows = []
300 if (hard) this.row_cache = []
301 }
302
303 destroyRow (row, hard) {
304 const holder = row.container

Callers 2

destroyMethod · 0.95

Calls 2

checkParentMethod · 0.95
destroyRowMethod · 0.95

Tested by

no test coverage detected