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

Method export

packages/core/src/document/node/node.ts:150–175  ·  view source on GitHub ↗
(stage: TRANSFORM_STAGE = TRANSFORM_STAGE.SAVE)

Source from the content-addressed store, hash-verified

148 }
149
150 export<T = NodeSchema>(stage: TRANSFORM_STAGE = TRANSFORM_STAGE.SAVE): T {
151 const baseSchema: any = {
152 componentName: this.componentName,
153 }
154
155 if (stage !== TRANSFORM_STAGE.CLONE) {
156 baseSchema.id = this.id
157 }
158 if (stage === TRANSFORM_STAGE.RENDER) {
159 baseSchema.docId = this.document.id
160 }
161
162 const { props, extras } = this.props.export()
163
164 const schema: any = {
165 ...baseSchema,
166 props: props ? this.document.designer.transformProps(props, this, stage) : undefined,
167 ...(extras ? this.document.designer.transformProps(extras, this, stage) : {}),
168 }
169
170 if (this.isParental && this.children && this.children.size > 0) {
171 schema.children = this.children.export(stage)
172 }
173
174 return schema
175 }
176
177 purge() {
178 if (this.purged) {

Callers 6

toDataMethod · 0.95
schemaMethod · 0.95
wrapWithMethod · 0.95
replaceWithMethod · 0.95
propsDataMethod · 0.45
insertChildFunction · 0.45

Calls 1

transformPropsMethod · 0.80

Tested by

no test coverage detected