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

Method internalSetParent

packages/core/src/document/node/node.ts:451–470  ·  view source on GitHub ↗
(parent: Node | null, useMutator = false)

Source from the content-addressed store, hash-verified

449 }
450
451 internalSetParent(parent: Node | null, useMutator = false) {
452 if (this._parent === parent) {
453 return
454 }
455
456 if (this._parent) {
457 this._parent.children?.unlinkChild(this)
458 }
459 if (useMutator) {
460 this._parent?.didDropOut(this)
461 }
462
463 if (parent) {
464 this._parent = parent
465
466 if (useMutator) {
467 parent.didDropIn(this)
468 }
469 }
470 }
471
472 internalUnlinkParent() {
473 this._parent = null

Callers 6

createNodeMethod · 0.80
importMethod · 0.80
internalInitParentMethod · 0.80
internalDeleteMethod · 0.80
internalInsertMethod · 0.80
mergeChildrenMethod · 0.80

Calls 3

unlinkChildMethod · 0.80
didDropOutMethod · 0.80
didDropInMethod · 0.80

Tested by

no test coverage detected