@cadenza.io/core 3.13.2 → 3.13.3

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/index.d.mts CHANGED
@@ -937,7 +937,7 @@ declare class Task extends SignalEmitter implements Graph {
937
937
  * @return {this} The current task instance for method chaining.
938
938
  * @throws {Error} Throws an error if adding a predecessor creates a cycle in the task structure.
939
939
  */
940
- doAfter(...tasks: Task[]): this;
940
+ doAfter(...tasks: (Task | undefined)[]): this;
941
941
  /**
942
942
  * Adds a sequence of tasks as successors to the current task, ensuring no cyclic dependencies are introduced.
943
943
  * Metrics are emitted when a relationship is successfully added.
@@ -946,7 +946,7 @@ declare class Task extends SignalEmitter implements Graph {
946
946
  * @return {this} Returns the current task instance for method chaining.
947
947
  * @throws {Error} Throws an error if adding a task causes a cyclic dependency.
948
948
  */
949
- then(...tasks: Task[]): this;
949
+ then(...tasks: (Task | undefined)[]): this;
950
950
  /**
951
951
  * Decouples the current task from the provided task by removing mutual references.
952
952
  *
package/dist/index.d.ts CHANGED
@@ -937,7 +937,7 @@ declare class Task extends SignalEmitter implements Graph {
937
937
  * @return {this} The current task instance for method chaining.
938
938
  * @throws {Error} Throws an error if adding a predecessor creates a cycle in the task structure.
939
939
  */
940
- doAfter(...tasks: Task[]): this;
940
+ doAfter(...tasks: (Task | undefined)[]): this;
941
941
  /**
942
942
  * Adds a sequence of tasks as successors to the current task, ensuring no cyclic dependencies are introduced.
943
943
  * Metrics are emitted when a relationship is successfully added.
@@ -946,7 +946,7 @@ declare class Task extends SignalEmitter implements Graph {
946
946
  * @return {this} Returns the current task instance for method chaining.
947
947
  * @throws {Error} Throws an error if adding a task causes a cyclic dependency.
948
948
  */
949
- then(...tasks: Task[]): this;
949
+ then(...tasks: (Task | undefined)[]): this;
950
950
  /**
951
951
  * Decouples the current task from the provided task by removing mutual references.
952
952
  *
package/dist/index.js CHANGED
@@ -170,15 +170,15 @@ var SignalBroker = class _SignalBroker {
170
170
  }
171
171
  }));
172
172
  return {
173
- __signals: processedSignals,
173
+ signals: processedSignals,
174
174
  ...ctx
175
175
  };
176
176
  });
177
177
  this.registerSignalTask = Cadenza.createMetaTask(
178
178
  "Register signal",
179
179
  (ctx) => {
180
- const { __signalName } = ctx;
181
- this.signalObservers.get(__signalName).registered = true;
180
+ const { signalName } = ctx;
181
+ this.signalObservers.get(signalName).registered = true;
182
182
  }
183
183
  ).doOn("meta.signal.registered");
184
184
  }
@@ -444,7 +444,7 @@ var SignalBroker = class _SignalBroker {
444
444
  return;
445
445
  }
446
446
  }
447
- this.emit("meta.signal_broker.added", { __signalName: _signal });
447
+ this.emit("meta.signal_broker.added", { signalName: _signal });
448
448
  }
449
449
  }
450
450
  /**
@@ -2420,6 +2420,7 @@ var Task = class _Task extends SignalEmitter {
2420
2420
  */
2421
2421
  doAfter(...tasks) {
2422
2422
  for (const pred of tasks) {
2423
+ if (!pred) continue;
2423
2424
  if (this.predecessorTasks.has(pred)) continue;
2424
2425
  pred.nextTasks.add(this);
2425
2426
  this.predecessorTasks.add(pred);
@@ -2450,6 +2451,7 @@ var Task = class _Task extends SignalEmitter {
2450
2451
  */
2451
2452
  then(...tasks) {
2452
2453
  for (const next of tasks) {
2454
+ if (!next) continue;
2453
2455
  if (this.nextTasks.has(next)) continue;
2454
2456
  this.nextTasks.add(next);
2455
2457
  next.predecessorTasks.add(this);