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

Method purge

packages/core/src/document/document.ts:168–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166
167 @action
168 purge() {
169 // 追踪物料使用:批量减少所有节点的使用计数
170 for (const node of this.nodes) {
171 if (node.componentName) {
172 this.designer.materials.decrementUsage(node.materialUsageKey)
173 }
174 }
175
176 this.rootNode?.purge()
177 this.nodes.clear()
178 this._nodesMap.clear()
179 this.rootNode = null
180 }
181
182 @action
183 createNode(schema: NodeSchema, checkId = true) {

Callers 1

removeMethod · 0.95

Calls 3

clearMethod · 0.80
decrementUsageMethod · 0.65
purgeMethod · 0.65

Tested by

no test coverage detected