MCPcopy Create free account
hub / github.com/Project-DARC/DARC / generateBooleanConditionNodeStruct

Method generateBooleanConditionNodeStruct

darc-js/src/SDK/Node.ts:54–80  ·  view source on GitHub ↗

* Generate a condition node struct for BOOLEAN_TRUE or BOOLEAN_FALSE * @param id The id of the condition node * @returns The condition node struct

(id: bigint)

Source from the content-addressed store, hash-verified

52 * @returns The condition node struct
53 */
54 private generateBooleanConditionNodeStruct(id: bigint): ConditionNodeStruct {
55 if (this.type !== "TRUE" && this.type !== "FALSE") {
56 throw new Error("Node type is not TRUE or FALSE");
57 }
58 if (this.type === "TRUE") {
59 const conditionNodeStruct: ConditionNodeStruct = {
60 id: id,
61 nodeType: 3,
62 logicalOperator: 0,
63 conditionExpression: 0,
64 childList: [],
65 param: this.nodeParam,
66 };
67 return conditionNodeStruct;
68 }
69 else {
70 const conditionNodeStruct: ConditionNodeStruct = {
71 id: id,
72 nodeType: 4,
73 logicalOperator: 0,
74 conditionExpression: 0,
75 childList: [],
76 param: this.nodeParam,
77 };
78 return conditionNodeStruct;
79 }
80 }
81
82 /**
83 * Generate a list of condition node structs for the AND node

Calls

no outgoing calls

Tested by

no test coverage detected