MCPcopy Index your code
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / if

Function if

web/js/common/binding.js:117–131  ·  view source on GitHub ↗

* @param {IfCallback} cb

(cb, state)

Source from the content-addressed store, hash-verified

115 * @param {IfCallback} cb
116 */
117 async if(cb, state) {
118 // For now only support ANDs
119 let success = true;
120 for (const condition of cb.condition) {
121 const r = evaluateCondition(condition, state);
122 if (!r) {
123 success = false;
124 break;
125 }
126 }
127
128 for (const m of cb[success + ""] ?? []) {
129 await invokeCallback(m, state);
130 }
131 },
132 /**
133 * @param {FetchCallback} cb
134 */

Callers

nothing calls this directly

Calls 2

evaluateConditionFunction · 0.85
invokeCallbackFunction · 0.85

Tested by

no test coverage detected