INNER CODE UNIT · JavaScript
foreachNeedsHtml
figranium/figranium · src/agent/figranite/index.js:373
const foreachNeedsHtml = actions.map((act, i) => {
if (act.type !== 'foreach') return false;
const endIndex = startToEnd[i];
if (endIndex === undefined) return true; // Safety fallback
for (let j = i + 1; j < endIndex; j++) {
if (actionNeedsLoopHtml[j]) return true;
}
return false;
});
// ⚡ Bolt: Hoist static action options out of the execution loop to avoid redundant object spreading (O(N))
const actionOptions = {
...data,
api_key: data.apiKey || data.key,
deadClicks,
humanTyping,
allowTypos,
naturalTyping,