MCPcopy
hub / github.com/basecamp/trix / isEmpty

Method isEmpty

src/trix/models/document.js:31–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 isEmpty() {
32 const block = this.getBlockAtIndex(0)
33 return this.blockList.length === 1 && block.isEmpty() && !block.hasAttributes()
34 }
35
36 copy(options = {}) {
37 const blocks = options.consolidateBlocks ? this.blockList.consolidate().toArray() : this.blockList.toArray()

Callers 1

insertDocumentAtRangeMethod · 0.45

Calls 2

getBlockAtIndexMethod · 0.95
hasAttributesMethod · 0.45

Tested by

no test coverage detected