MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / replaceWith

Method replaceWith

packages/core/src/document/node/node.ts:624–628  ·  view source on GitHub ↗

* replace this node with a new node

(schema: Schema, migrate = false)

Source from the content-addressed store, hash-verified

622 * replace this node with a new node
623 */
624 replaceWith(schema: Schema, migrate = false) {
625 // reuse the same id? or replaceSelection
626 schema = Object.assign({}, migrate ? this.export() : {}, schema)
627 return this.parent?.replaceChild(this, schema)
628 }
629
630 /**
631 * replace a child node with a new node

Callers 2

wrapWithMethod · 0.95
executeOperationFunction · 0.80

Calls 2

exportMethod · 0.95
replaceChildMethod · 0.80

Tested by

no test coverage detected