MCPcopy Create free account
hub / github.com/SplootCode/splootcode / constructor

Method constructor

packages/core/src/language/childset.ts:25–48  ·  view source on GitHub ↗
(
    owner: SplootNode,
    childSetId: string,
    type: ChildSetType,
    nodeCategory: NodeCategory,
    minChildren: number,
    maxChildren: number
  )

Source from the content-addressed store, hash-verified

23 enableMutations: boolean
24
25 constructor(
26 owner: SplootNode,
27 childSetId: string,
28 type: ChildSetType,
29 nodeCategory: NodeCategory,
30 minChildren: number,
31 maxChildren: number
32 ) {
33 this.children = []
34 this.childParentRef = new ParentReference(owner, childSetId)
35 this.type = type
36 this.minChildren = minChildren
37 if (this.type === ChildSetType.Single) {
38 this.maxChildren = 1
39 } else if (this.type === ChildSetType.Immutable) {
40 this.maxChildren = minChildren
41 } else {
42 this.maxChildren = maxChildren
43 }
44
45 this.nodeCategory = nodeCategory
46 this.mutationObservers = []
47 this.enableMutations = false
48 }
49
50 getParentRef() {
51 return this.childParentRef

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected