@code0-tech/triangulum 0.19.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
25
25
  import ReturnType = Utils.ReturnType;
26
26
  `;function C(e,t){let n=new Map;return n.set(e,t),n.set(`lib.codezero.d.ts`,S),p(ee(n),[e,`lib.codezero.d.ts`],c.default,re)}var re={target:c.default.ScriptTarget.Latest,lib:[`lib.codezero.d.ts`],noEmit:!0,strictNullChecks:!0};function w(e,t=`any`,n=!0){let r=Array.from(new Set(e?.flatMap(e=>e.genericKeys||[]))).map(e=>`type ${e} = ${t};`).join(`
27
27
  `),i=e?.map(e=>`type ${e.identifier}${(e.genericKeys?.length??0)>0?`<${e.genericKeys?.join(`,`)}>`:``} = ${e.type};`).join(`
28
- `);return`${n?r:``}\n${i}`}var T=e=>e?.replace(/[^a-zA-Z0-9]/g,`_`);function E(e,t,n,r=!1){let i=e?.nodes?.nodes||[],a=new Map(t?.map(e=>[e.identifier,e])),o=new Set,s=(t,n=``)=>{let c=i.find(e=>e?.id===t);if(!c||!c.functionDefinition)return``;if(t?.includes(`NodeFunction`)&&o.add(t),!a.get(c.functionDefinition.identifier))return`${n}// Error: Function ${c.functionDefinition.identifier} not found\n`;let l=(c.parameters?.nodes||[]).map((i,a)=>{let o=i.value;if(!o)return r?`/* @pos ${t} ${a} */ {}`:`/* @pos ${t} ${a} */ undefined`;if(o.__typename===`ReferenceValue`){let n=o,r=typeof n.inputIndex==`number`?`p_${T(n.nodeFunctionId??`undefined`)}_${n.parameterIndex}[${n.inputIndex}]`:n.nodeFunctionId?`node_${T(n.nodeFunctionId)}`:`flow_${T(e?.id??`undefined`)}`;return n.referencePath?.forEach(e=>{r+=`?.${e.path}`}),`/* @pos ${t} ${a} */ ${r}`}if(o.__typename===`LiteralValue`)return`/* @pos ${t} ${a} */ ${b(o?.value)}`;if(o.__typename===`SubFlowValue`){let e=o;return`/* @pos ${t} ${a} */ (...${`p_${T(t)}_${a}`}) => {\n${s(e.startingNodeId||e.functionDefinition?.id,n+` `)}${n}}`}return r?`/* @pos ${t} ${a} */ {}`:`/* @pos ${t} ${a} */ undefined`}),u=`node_${T(c.id)}`,d=`fn_${c?.functionDefinition?.identifier?.replace(/::/g,`_`)}`;l.includes(`undefined`);let f=`${n}`;return c.functionDefinition.identifier===`std::control::return`?f+=`return /* @pos ${t} null */ ${d}(${l.join(`, `)}) ;\n`:c.functionDefinition.identifier===`std::control::if`?(f+=`const ${u} = /* @pos ${t} null */ ${d}(${l.join(`, `)}) ;\n`,f+=`if(${l[0]}) {
28
+ `);return`${n?r:``}\n${i}`}var T=e=>e?.replace(/[^a-zA-Z0-9]/g,`_`);function E(e,t,n,r=!1){let i=e?.nodes?.nodes||[],a=new Map(t?.map(e=>[e.identifier,e])),o=new Set,s=(t,n=``)=>{let c=i.find(e=>e?.id===t);if(!c||!c.functionDefinition)return``;if(t?.includes(`NodeFunction`)&&o.add(t),!a.get(c.functionDefinition.identifier))return`${n}// Error: Function ${c.functionDefinition.identifier} not found\n`;let l=(c.parameters?.nodes||[]).map((i,a)=>{let o=i.value;if(!o)return r?`/* @pos ${t} ${a} */ {}`:`/* @pos ${t} ${a} */ undefined`;if(o.__typename===`ReferenceValue`){let n=o,r=typeof n.inputIndex==`number`?`p_${T(n.nodeFunctionId??`undefined`)}_${n.parameterIndex}[${n.inputIndex}]`:n.nodeFunctionId?`node_${T(n.nodeFunctionId)}`:`flow_${T(e?.id??`undefined`)}`;return n.referencePath?.forEach(e=>{r+=`?.${e.path}`}),`/* @pos ${t} ${a} */ ${r}`}if(o.__typename===`LiteralValue`)return`/* @pos ${t} ${a} */ ${b(o?.value)}`;if(o.__typename===`SubFlowValue`){let e=o;return`/* @pos ${t} ${a} */ (...${`p_${T(t)}_${a}`}) => {\n${s(e.startingNodeId||e.functionDefinition?.id,n+` `)}${n}}`}return r?`/* @pos ${t} ${a} */ {}`:`/* @pos ${t} ${a} */ undefined`}),u=`node_${T(c.id)}`,d=`fn_${c?.functionDefinition?.identifier?.replace(/::/g,`_`)}`;l.includes(`undefined`);let f=`${n}`;return c.functionDefinition.identifier===`std::control::return`?(f+=`const ${u} = /* @pos ${t} null */ ${d}(${l.join(`, `)}) ;\n`,f+=`return ${u};\n`):c.functionDefinition.identifier===`std::control::if`?(f+=`const ${u} = /* @pos ${t} null */ ${d}(${l.join(`, `)}) ;\n`,f+=`if(${l[0]}) {
29
29
  ${s(c.parameters?.nodes?.[1]?.value?.startingNodeId||(c.parameters?.nodes?.[1]?.value)?.functionDefinition?.identifier,n+` `)}
30
30
  }`):c.functionDefinition.identifier===`std::control::if_else`?(f+=`const ${u} = /* @pos ${t} null */ ${d}(${l.join(`, `)}) ;\n`,f+=`if(${l[0]}) {
31
31
  ${s(c.parameters?.nodes?.[1]?.value?.startingNodeId||(c.parameters?.nodes?.[1]?.value)?.functionDefinition?.identifier,n+` `)}
@@ -283,7 +283,7 @@ function S(e, t, n, r = !1) {
283
283
  }), u = `node_${x(c.id)}`, d = `fn_${c?.functionDefinition?.identifier?.replace(/::/g, "_")}`;
284
284
  l.includes("undefined");
285
285
  let f = `${n}`;
286
- return c.functionDefinition.identifier === "std::control::return" ? f += `return /* @pos ${t} null */ ${d}(${l.join(", ")}) ;\n` : c.functionDefinition.identifier === "std::control::if" ? (f += `const ${u} = /* @pos ${t} null */ ${d}(${l.join(", ")}) ;\n`, f += `if(${l[0]}) {
286
+ return c.functionDefinition.identifier === "std::control::return" ? (f += `const ${u} = /* @pos ${t} null */ ${d}(${l.join(", ")}) ;\n`, f += `return ${u};\n`) : c.functionDefinition.identifier === "std::control::if" ? (f += `const ${u} = /* @pos ${t} null */ ${d}(${l.join(", ")}) ;\n`, f += `if(${l[0]}) {
287
287
  ${s(c.parameters?.nodes?.[1]?.value?.startingNodeId || (c.parameters?.nodes?.[1]?.value)?.functionDefinition?.identifier, n + " ")}
288
288
  }`) : c.functionDefinition.identifier === "std::control::if_else" ? (f += `const ${u} = /* @pos ${t} null */ ${d}(${l.join(", ")}) ;\n`, f += `if(${l[0]}) {
289
289
  ${s(c.parameters?.nodes?.[1]?.value?.startingNodeId || (c.parameters?.nodes?.[1]?.value)?.functionDefinition?.identifier, n + " ")}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/triangulum",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/code0-tech/triangulum#readme",
6
6
  "bugs": {