@modern-js/plugin 2.35.1 → 2.36.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.
@@ -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
- export const isAsyncWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
5
- export const createAsyncWorkflow = () => {
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
- export const isParallelWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
4
- export const createParallelWorkflow = () => {
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
- export const createWorkflow = () => {
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
- export const isWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
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.35.1",
18
+ "version": "2.36.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.35.1"
36
+ "@modern-js/utils": "2.36.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.35.1",
44
- "@scripts/jest-config": "2.35.1"
43
+ "@scripts/build": "2.36.0",
44
+ "@scripts/jest-config": "2.36.0"
45
45
  },
46
46
  "sideEffects": false,
47
47
  "publishConfig": {