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

Method copyUsingObjectMap

src/trix/models/document.js:47–53  ·  view source on GitHub ↗
(objectMap)

Source from the content-addressed store, hash-verified

45 }
46
47 copyUsingObjectMap(objectMap) {
48 const blocks = this.getBlocks().map((block) => {
49 const mappedBlock = objectMap.find(block)
50 return mappedBlock || block.copyUsingObjectMap(objectMap)
51 })
52 return new this.constructor(blocks)
53 }
54
55 copyWithBaseBlockAttributes(blockAttributes = []) {
56 const blocks = this.getBlocks().map((block) => {

Callers 1

Calls 2

getBlocksMethod · 0.95
findMethod · 0.45

Tested by

no test coverage detected