@modern-js/plugin 2.35.1 → 2.37.0
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/cjs/farrow-pipeline/context.js +24 -7
- package/dist/cjs/farrow-pipeline/counter.js +24 -7
- package/dist/cjs/farrow-pipeline/index.js +32 -24
- package/dist/cjs/index.js +26 -7
- package/dist/cjs/manager/async.js +33 -16
- package/dist/cjs/manager/index.js +24 -6
- package/dist/cjs/manager/shared.js +33 -26
- package/dist/cjs/manager/sync.js +52 -45
- package/dist/cjs/manager/types.js +15 -3
- package/dist/cjs/waterfall/async.js +29 -20
- package/dist/cjs/waterfall/index.js +22 -5
- package/dist/cjs/waterfall/sync.js +29 -20
- package/dist/cjs/workflow/async.js +27 -17
- package/dist/cjs/workflow/index.js +24 -6
- package/dist/cjs/workflow/parallel.js +27 -17
- package/dist/cjs/workflow/sync.js +27 -17
- package/dist/esm/index.js +35 -35
- package/dist/esm-node/farrow-pipeline/context.js +4 -1
- package/dist/esm-node/farrow-pipeline/counter.js +4 -1
- package/dist/esm-node/farrow-pipeline/index.js +9 -4
- package/dist/esm-node/manager/async.js +4 -1
- package/dist/esm-node/manager/shared.js +12 -5
- package/dist/esm-node/manager/sync.js +12 -5
- package/dist/esm-node/manager/types.js +0 -1
- package/dist/esm-node/waterfall/async.js +8 -3
- package/dist/esm-node/waterfall/sync.js +8 -3
- package/dist/esm-node/workflow/async.js +6 -2
- package/dist/esm-node/workflow/parallel.js +6 -2
- package/dist/esm-node/workflow/sync.js +6 -2
- package/package.json +4 -4
@@ -1,8 +1,8 @@
|
|
1
1
|
import { createAsyncPipeline } from "../farrow-pipeline";
|
2
2
|
const ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
|
3
3
|
const isPromise = (obj) => obj && typeof obj.then === "function";
|
4
|
-
|
5
|
-
|
4
|
+
const isAsyncWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
|
5
|
+
const createAsyncWorkflow = () => {
|
6
6
|
const pipeline = createAsyncPipeline();
|
7
7
|
const use = (...input) => {
|
8
8
|
pipeline.use(...input.map(mapAsyncWorkerToAsyncMiddleware));
|
@@ -29,3 +29,7 @@ const mapAsyncWorkerToAsyncMiddleware = (worker) => (input, next) => Promise.res
|
|
29
29
|
result,
|
30
30
|
...nextResult
|
31
31
|
]));
|
32
|
+
export {
|
33
|
+
createAsyncWorkflow,
|
34
|
+
isAsyncWorkflow
|
35
|
+
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createPipeline } from "../farrow-pipeline";
|
2
2
|
const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
3
|
-
|
4
|
-
|
3
|
+
const isParallelWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
|
4
|
+
const createParallelWorkflow = () => {
|
5
5
|
const pipeline = createPipeline();
|
6
6
|
const use = (...input) => {
|
7
7
|
pipeline.use(...input.map(mapParallelWorkerToAsyncMiddleware));
|
@@ -22,3 +22,7 @@ const mapParallelWorkerToAsyncMiddleware = (worker) => (input, next) => [
|
|
22
22
|
worker(input),
|
23
23
|
...next(input)
|
24
24
|
];
|
25
|
+
export {
|
26
|
+
createParallelWorkflow,
|
27
|
+
isParallelWorkflow
|
28
|
+
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createPipeline } from "../farrow-pipeline";
|
2
2
|
const WORKFLOW_SYMBOL = Symbol.for("MODERN_WORKFLOW");
|
3
|
-
|
3
|
+
const createWorkflow = () => {
|
4
4
|
const pipeline = createPipeline();
|
5
5
|
const use = (...input) => {
|
6
6
|
pipeline.use(...input.map(mapWorkerToMiddleware));
|
@@ -20,8 +20,12 @@ export const createWorkflow = () => {
|
|
20
20
|
};
|
21
21
|
return workflow;
|
22
22
|
};
|
23
|
-
|
23
|
+
const isWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
|
24
24
|
const mapWorkerToMiddleware = (worker) => (input, next) => [
|
25
25
|
worker(input),
|
26
26
|
...next(input)
|
27
27
|
];
|
28
|
+
export {
|
29
|
+
createWorkflow,
|
30
|
+
isWorkflow
|
31
|
+
};
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.37.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -33,15 +33,15 @@
|
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
35
|
"@swc/helpers": "0.5.1",
|
36
|
-
"@modern-js/utils": "2.
|
36
|
+
"@modern-js/utils": "2.37.0"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
39
|
"@types/jest": "^29",
|
40
40
|
"@types/node": "^14",
|
41
41
|
"typescript": "^5",
|
42
42
|
"jest": "^29",
|
43
|
-
"@scripts/build": "2.
|
44
|
-
"@scripts/jest-config": "2.
|
43
|
+
"@scripts/build": "2.37.0",
|
44
|
+
"@scripts/jest-config": "2.37.0"
|
45
45
|
},
|
46
46
|
"sideEffects": false,
|
47
47
|
"publishConfig": {
|