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

Method import

packages/core/src/document/document.ts:141–153  ·  view source on GitHub ↗
(schema?: RootSchema, checkId = false)

Source from the content-addressed store, hash-verified

139
140 @action
141 import(schema?: RootSchema, checkId = false) {
142 this.nodes.forEach(node => {
143 if (node.isRoot) return
144 this.internalRemoveNode(node, true)
145 })
146
147 if (schema) {
148 this.rootNode?.import(schema, checkId)
149 this._blank = false
150 } else {
151 this._blank = true
152 }
153 }
154
155 export(stage: TRANSFORM_STAGE = TRANSFORM_STAGE.SAVE) {
156 return this.rootNode!.export<RootSchema>(stage)

Callers 2

constructorMethod · 0.95
createNodeMethod · 0.45

Calls 2

internalRemoveNodeMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected