MCPcopy Create free account
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / evaluateCondition

Function evaluateCondition

web/js/common/binding.js:96–108  ·  view source on GitHub ↗

* @param {IfCondition} condition

(condition, state)

Source from the content-addressed store, hash-verified

94 * @param {IfCondition} condition
95 */
96function evaluateCondition(condition, state) {
97 const left = PathHelper.get(state, condition.left);
98 const right = PathHelper.get(state, condition.right);
99
100 let r;
101 if (condition.op === "eq") {
102 r = left === right;
103 } else {
104 r = left !== right;
105 }
106
107 return r;
108}
109
110/**
111 * @type { Record<BindingCallback["type"], (cb: any, state: Record<string, any>) => Promise<void>> }

Callers 1

ifFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected