* Disconnects this group from its parents, children, and chunks. * Child groups are reconnected to this group's parents so the surrounding * graph remains intact after removal. * @returns {void}
()
| 489 | * @returns {void} |
| 490 | */ |
| 491 | remove() { |
| 492 | // cleanup parents |
| 493 | for (const parentChunkGroup of this._parents) { |
| 494 | // remove this chunk from its parents |
| 495 | parentChunkGroup._children.delete(this); |
| 496 | |
| 497 | // cleanup "sub chunks" |
| 498 | for (const chunkGroup of this._children) { |
| 499 | /** |
| 500 | * remove this chunk as "intermediary" and connect |
| 501 | * it "sub chunks" and parents directly |
| 502 | */ |
| 503 | // add parent to each "sub chunk" |
| 504 | chunkGroup.addParent(parentChunkGroup); |
| 505 | // add "sub chunk" to parent |
| 506 | parentChunkGroup.addChild(chunkGroup); |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | /** |
| 511 | * we need to iterate again over the children |
| 512 | * to remove this from the child's parents. |
| 513 | * This can not be done in the above loop |
| 514 | * as it is not guaranteed that `this._parents` contains anything. |
| 515 | */ |
| 516 | for (const chunkGroup of this._children) { |
| 517 | // remove this as parent of every "sub chunk" |
| 518 | chunkGroup._parents.delete(this); |
| 519 | } |
| 520 | |
| 521 | // remove chunks |
| 522 | for (const chunk of this.chunks) { |
| 523 | chunk.removeGroup(this); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | sortItems() { |
| 528 | this.origins.sort(sortOrigin); |
nothing calls this directly
no test coverage detected