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

Method initialChildren

packages/core/src/document/node/node.ts:219–237  ·  view source on GitHub ↗

* relate to componentMeta.advanced.initialChildren

(children: NodeSchema | NodeSchema[] | undefined)

Source from the content-addressed store, hash-verified

217 * relate to componentMeta.advanced.initialChildren
218 */
219 private initialChildren(children: NodeSchema | NodeSchema[] | undefined): NodeSchema[] {
220 const { initialChildren } = this.componentMeta.advanced
221
222 if (children == null) {
223 if (initialChildren) {
224 if (typeof initialChildren === 'function') {
225 return initialChildren(this) || []
226 }
227 return initialChildren
228 }
229 return []
230 }
231
232 if (Array.isArray(children)) {
233 return children
234 }
235
236 return [children]
237 }
238
239 /**
240 * link to componentMeta.advanced.callbacks.onNodeAdd

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected