diff --git a/README.md b/README.md index 17ec798..515cc76 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -
-A fast and reliable flow engine for orchestration and more uses in Node.js, Deno and the browser.
-+
+A fast and reliable flow engine for orchestration and more uses in Node.js, Deno and the browser.
+
diff --git a/src/engine/flow-run-status.ts b/src/engine/flow-run-status.ts
index 7481e20..3f98209 100644
--- a/src/engine/flow-run-status.ts
+++ b/src/engine/flow-run-status.ts
@@ -104,7 +104,8 @@ export class FlowRunStatus {
// To be used later to check if expectedResults can be fulfilled.
this.taskProvisions = Array.from(new Set(provisions));
- this.options = Object.assign({}, this.spec.configs ?? {}, this.spec.options ?? {});
+ this.options = { ...this.spec.configs, ...this.spec.options };
+
if (Object.prototype.hasOwnProperty.call(this.spec, 'configs')) {
this.flow.log({ m: "DEPRECATED: 'configs' field in flow spec. Use 'options' instead.", l: 'w' });
}
@@ -174,7 +175,7 @@ export class FlowRunStatus {
taskStatuses: {},
};
- const serializableContext = Object.assign({}, this.context);
+ const serializableContext = { ...this.context };
delete serializableContext.$flowed;
serialized.context = JSON.parse(JSON.stringify(serializableContext));
diff --git a/src/engine/flow-state/flow-state.ts b/src/engine/flow-state/flow-state.ts
index 434cc71..2ec4a58 100644
--- a/src/engine/flow-state/flow-state.ts
+++ b/src/engine/flow-state/flow-state.ts
@@ -365,10 +365,10 @@ export abstract class FlowState implements IFlow {
public static formatDebugMessage({ n, m, l, e }: { n?: number; m: string; mp?: ValueMap; l?: string; e?: string }): string {
const levelIcon = l === 'w' ? '⚠️ ' : '';
const eventIcons = { FS: '▶ ', FF: '✔ ', TS: ' ‣ ', TF: ' ✓ ', FC: ' ⓘ ', FT: '◼ ', FP: '⏸ ' };
- let eventIcon = (eventIcons as any)[e || ''] ?? ''; // eslint-disable-line @typescript-eslint/no-explicit-any
- if (e === 'TF' && ['e', 'f'].includes(l || '')) {
+ let eventIcon = (eventIcons as any)[e ?? ''] ?? ''; // eslint-disable-line @typescript-eslint/no-explicit-any
+ if (e === 'TF' && ['e', 'f'].includes(l ?? '')) {
eventIcon = ' ✗';
- } else if (e === 'FF' && ['e', 'f'].includes(l || '')) {
+ } else if (e === 'FF' && ['e', 'f'].includes(l ?? '')) {
eventIcon = '✘';
}
const icon = levelIcon + eventIcon;
diff --git a/test/edge-cases.ts b/test/edge-cases.ts
index bc5ccb7..575776d 100644
--- a/test/edge-cases.ts
+++ b/test/edge-cases.ts
@@ -1,6 +1,5 @@
import { expect } from 'chai';
-import { FlowManager, ValueMap } from '../src';
-import { Task } from '../src';
+import { FlowManager, ValueMap, Task } from '../src';
describe('edge cases', () => {
it('manually provide unexpected requirement to task must throw an error', async () => {
diff --git a/test/examples-inline/microservices.ts b/test/examples-inline/microservices.ts
index 7284fff..8472179 100644
--- a/test/examples-inline/microservices.ts
+++ b/test/examples-inline/microservices.ts
@@ -1,5 +1,4 @@
-import { ValueMap } from '../../src';
-import { FlowManager } from '../../src';
+import { ValueMap, FlowManager } from '../../src';
import { ExampleFunction } from '../examples/types';
const callMicroservice = (params: ValueMap) => {
@@ -23,7 +22,7 @@ const callMicroservice = (params: ValueMap) => {
};
const simpleMerge = (params: ValueMap) => ({
- result: Object.assign({}, params.obj1, params.obj2),
+ result: { ...params.obj1, ...params.obj2 },
});
// noinspection JSUnusedGlobalSymbols
diff --git a/test/examples-inline/pythagoras.ts b/test/examples-inline/pythagoras.ts
index a151f6d..bb7510c 100644
--- a/test/examples-inline/pythagoras.ts
+++ b/test/examples-inline/pythagoras.ts
@@ -1,5 +1,4 @@
-import { ValueMap } from '../../src';
-import { FlowManager } from '../../src';
+import { ValueMap, FlowManager } from '../../src';
import { ExampleFunction } from '../examples/types';
// Example of named function used as resolver
diff --git a/test/examples/apparent-circular-deps.ts b/test/examples/apparent-circular-deps.ts
index c932737..2ba293f 100644
--- a/test/examples/apparent-circular-deps.ts
+++ b/test/examples/apparent-circular-deps.ts
@@ -1,5 +1,4 @@
-import { ValueMap } from '../../src';
-import { FlowManager } from '../../src';
+import { ValueMap, FlowManager } from '../../src';
import { ExampleFunction } from './types';
class DummyResolver {
diff --git a/test/examples/dependencies.ts b/test/examples/dependencies.ts
index c0bb156..cc6ed12 100644
--- a/test/examples/dependencies.ts
+++ b/test/examples/dependencies.ts
@@ -1,5 +1,4 @@
-import { ValueMap } from '../../src';
-import { FlowManager } from '../../src';
+import { ValueMap, FlowManager } from '../../src';
import { ExampleFunction } from './types';
class DummyResolver {
diff --git a/test/examples/microservices.ts b/test/examples/microservices.ts
index 167b373..cd83c67 100644
--- a/test/examples/microservices.ts
+++ b/test/examples/microservices.ts
@@ -1,5 +1,4 @@
-import { ValueMap } from '../../src';
-import { FlowManager } from '../../src';
+import { ValueMap, FlowManager } from '../../src';
import { ExampleFunction } from './types';
class CallMicroservice {
@@ -27,7 +26,7 @@ class CallMicroservice {
class SimpleMerge {
public async exec(params: ValueMap): Promise