@workglow/task-graph 0.0.71 → 0.0.73

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.
package/dist/bun.js CHANGED
@@ -1445,8 +1445,14 @@ class GraphAsTaskRunner extends TaskRunner {
1445
1445
  super.handleDisable();
1446
1446
  }
1447
1447
  fixInput(input) {
1448
+ const inputSchema = this.task.inputSchema();
1449
+ if (typeof inputSchema === "boolean") {
1450
+ return input;
1451
+ }
1448
1452
  const flattenedInput = Object.entries(input).reduce((acc, [key, value]) => {
1449
- if (Array.isArray(value)) {
1453
+ const inputDef = inputSchema.properties?.[key];
1454
+ const shouldFlatten = Array.isArray(value) && typeof inputDef === "object" && inputDef !== null && "x-replicate" in inputDef && inputDef["x-replicate"] === true;
1455
+ if (shouldFlatten) {
1450
1456
  return { ...acc, [key]: value[0] };
1451
1457
  }
1452
1458
  return { ...acc, [key]: value };
@@ -2364,7 +2370,6 @@ class ArrayTask extends GraphAsTask {
2364
2370
  super.regenerateGraph();
2365
2371
  return;
2366
2372
  }
2367
- this.subGraph = new TaskGraph;
2368
2373
  const inputIds = Array.from(arrayInputs.keys());
2369
2374
  const inputObject = Object.fromEntries(arrayInputs);
2370
2375
  const combinations = this.generateCombinations(inputObject, inputIds);
@@ -2968,4 +2973,4 @@ export {
2968
2973
  ArrayTask
2969
2974
  };
2970
2975
 
2971
- //# debugId=2F96C85065C7570864756E2164756E21
2976
+ //# debugId=B0A1A0458E7C632864756E2164756E21