@modern-js/plugin 0.0.0-nightly-20230925160549 → 0.0.0-nightly-20230927160620
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/index.js +2 -6
- package/dist/cjs/manager/sync.js +1 -2
- package/dist/cjs/waterfall/async.js +1 -4
- package/dist/cjs/waterfall/sync.js +1 -4
- package/dist/cjs/workflow/async.js +1 -4
- package/dist/cjs/workflow/parallel.js +1 -4
- package/dist/cjs/workflow/sync.js +1 -4
- package/dist/esm/index.js +8 -16
- package/dist/esm-node/farrow-pipeline/index.js +2 -6
- package/dist/esm-node/manager/sync.js +1 -2
- package/dist/esm-node/waterfall/async.js +1 -4
- package/dist/esm-node/waterfall/sync.js +1 -4
- package/dist/esm-node/workflow/async.js +1 -4
- package/dist/esm-node/workflow/parallel.js +1 -4
- package/dist/esm-node/workflow/sync.js +1 -4
- package/package.json +4 -4
@@ -26,10 +26,7 @@ __export(farrow_pipeline_exports, {
|
|
26
26
|
module.exports = __toCommonJS(farrow_pipeline_exports);
|
27
27
|
var import_context = require("./context");
|
28
28
|
var import_counter = require("./counter");
|
29
|
-
const isPipeline = (input) =>
|
30
|
-
var _input;
|
31
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PipelineSymbol]);
|
32
|
-
};
|
29
|
+
const isPipeline = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PipelineSymbol]);
|
33
30
|
const PipelineSymbol = Symbol.for("MODERN_PIPELINE");
|
34
31
|
const getMiddleware = (input) => {
|
35
32
|
if (typeof input === "function") {
|
@@ -58,11 +55,10 @@ const createPipeline = () => {
|
|
58
55
|
};
|
59
56
|
const currentCounter = createCurrentCounter();
|
60
57
|
const getCounter = (options) => {
|
61
|
-
var _options;
|
62
58
|
if (!options) {
|
63
59
|
return currentCounter;
|
64
60
|
}
|
65
|
-
return createCurrentCounter(
|
61
|
+
return createCurrentCounter(options === null || options === void 0 ? void 0 : options.onLast);
|
66
62
|
};
|
67
63
|
const run = (input, options) => getCounter(options).start(input);
|
68
64
|
const middleware = (input, next) => run(input, {
|
package/dist/cjs/manager/sync.js
CHANGED
@@ -136,8 +136,7 @@ const generateRunner = (hooksList, hooksMap) => {
|
|
136
136
|
if (hooksMap) {
|
137
137
|
for (const key in cloneShape) {
|
138
138
|
hooksList.forEach((hooks) => {
|
139
|
-
|
140
|
-
if ((_hooks = hooks) === null || _hooks === void 0 ? void 0 : _hooks[key]) {
|
139
|
+
if (hooks === null || hooks === void 0 ? void 0 : hooks[key]) {
|
141
140
|
cloneShape[key].use(hooks[key]);
|
142
141
|
}
|
143
142
|
});
|
@@ -58,10 +58,7 @@ const createAsyncWaterfall = () => {
|
|
58
58
|
};
|
59
59
|
return waterfall;
|
60
60
|
};
|
61
|
-
const isAsyncWaterfall = (input) =>
|
62
|
-
var _input;
|
63
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WATERFALL_SYMBOL]);
|
64
|
-
};
|
61
|
+
const isAsyncWaterfall = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WATERFALL_SYMBOL]);
|
65
62
|
const mapAsyncBrookToAsyncMiddleware = (brook) => (input, next) => Promise.resolve(brook(input)).then((result) => next(result));
|
66
63
|
// Annotate the CommonJS export names for ESM import in node:
|
67
64
|
0 && (module.exports = {
|
@@ -57,10 +57,7 @@ const createWaterfall = () => {
|
|
57
57
|
};
|
58
58
|
return waterfall;
|
59
59
|
};
|
60
|
-
const isWaterfall = (input) =>
|
61
|
-
var _input;
|
62
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WATERFALL_SYMBOL]);
|
63
|
-
};
|
60
|
+
const isWaterfall = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WATERFALL_SYMBOL]);
|
64
61
|
const mapBrookToMiddleware = (brook) => (input, next) => next(brook(input));
|
65
62
|
// Annotate the CommonJS export names for ESM import in node:
|
66
63
|
0 && (module.exports = {
|
@@ -25,10 +25,7 @@ module.exports = __toCommonJS(async_exports);
|
|
25
25
|
var import_farrow_pipeline = require("../farrow-pipeline");
|
26
26
|
const ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
|
27
27
|
const isPromise = (obj) => obj && typeof obj.then === "function";
|
28
|
-
const isAsyncWorkflow = (input) =>
|
29
|
-
var _input;
|
30
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WORKFLOW_SYMBOL]);
|
31
|
-
};
|
28
|
+
const isAsyncWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
|
32
29
|
const createAsyncWorkflow = () => {
|
33
30
|
const pipeline = (0, import_farrow_pipeline.createAsyncPipeline)();
|
34
31
|
const use = (...input) => {
|
@@ -24,10 +24,7 @@ __export(parallel_exports, {
|
|
24
24
|
module.exports = __toCommonJS(parallel_exports);
|
25
25
|
var import_farrow_pipeline = require("../farrow-pipeline");
|
26
26
|
const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
27
|
-
const isParallelWorkflow = (input) =>
|
28
|
-
var _input;
|
29
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PARALLEL_WORKFLOW_SYMBOL]);
|
30
|
-
};
|
27
|
+
const isParallelWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
|
31
28
|
const createParallelWorkflow = () => {
|
32
29
|
const pipeline = (0, import_farrow_pipeline.createPipeline)();
|
33
30
|
const use = (...input) => {
|
@@ -44,10 +44,7 @@ const createWorkflow = () => {
|
|
44
44
|
};
|
45
45
|
return workflow;
|
46
46
|
};
|
47
|
-
const isWorkflow = (input) =>
|
48
|
-
var _input;
|
49
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WORKFLOW_SYMBOL]);
|
50
|
-
};
|
47
|
+
const isWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
|
51
48
|
const mapWorkerToMiddleware = (worker) => (input, next) => [
|
52
49
|
worker(input),
|
53
50
|
...next(input)
|
package/dist/esm/index.js
CHANGED
@@ -45,8 +45,7 @@ var createCounter = function(callback) {
|
|
45
45
|
|
46
46
|
// src/farrow-pipeline/index.ts
|
47
47
|
var isPipeline = function(input) {
|
48
|
-
|
49
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PipelineSymbol]);
|
48
|
+
return Boolean(input === null || input === void 0 ? void 0 : input[PipelineSymbol]);
|
50
49
|
};
|
51
50
|
var PipelineSymbol = Symbol.for("MODERN_PIPELINE");
|
52
51
|
var getMiddleware = function(input) {
|
@@ -80,11 +79,10 @@ var createPipeline = function() {
|
|
80
79
|
};
|
81
80
|
var currentCounter = createCurrentCounter();
|
82
81
|
var getCounter = function(options) {
|
83
|
-
var _options;
|
84
82
|
if (!options) {
|
85
83
|
return currentCounter;
|
86
84
|
}
|
87
|
-
return createCurrentCounter(
|
85
|
+
return createCurrentCounter(options === null || options === void 0 ? void 0 : options.onLast);
|
88
86
|
};
|
89
87
|
var run = function(input, options) {
|
90
88
|
return getCounter(options).start(input);
|
@@ -149,8 +147,7 @@ var createWaterfall = function() {
|
|
149
147
|
return waterfall;
|
150
148
|
};
|
151
149
|
var isWaterfall = function(input) {
|
152
|
-
|
153
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WATERFALL_SYMBOL]);
|
150
|
+
return Boolean(input === null || input === void 0 ? void 0 : input[WATERFALL_SYMBOL]);
|
154
151
|
};
|
155
152
|
var mapBrookToMiddleware = function(brook) {
|
156
153
|
return function(input, next) {
|
@@ -205,8 +202,7 @@ var createAsyncWaterfall = function() {
|
|
205
202
|
return waterfall;
|
206
203
|
};
|
207
204
|
var isAsyncWaterfall = function(input) {
|
208
|
-
|
209
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WATERFALL_SYMBOL]);
|
205
|
+
return Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WATERFALL_SYMBOL]);
|
210
206
|
};
|
211
207
|
var mapAsyncBrookToAsyncMiddleware = function(brook) {
|
212
208
|
return function(input, next) {
|
@@ -247,8 +243,7 @@ var createWorkflow = function() {
|
|
247
243
|
return workflow;
|
248
244
|
};
|
249
245
|
var isWorkflow = function(input) {
|
250
|
-
|
251
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WORKFLOW_SYMBOL]);
|
246
|
+
return Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
|
252
247
|
};
|
253
248
|
var mapWorkerToMiddleware = function(worker) {
|
254
249
|
return function(input, next) {
|
@@ -265,8 +260,7 @@ import { _ as _object_spread_props4 } from "@swc/helpers/_/_object_spread_props"
|
|
265
260
|
import { _ as _to_consumable_array5 } from "@swc/helpers/_/_to_consumable_array";
|
266
261
|
var PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
267
262
|
var isParallelWorkflow = function(input) {
|
268
|
-
|
269
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PARALLEL_WORKFLOW_SYMBOL]);
|
263
|
+
return Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
|
270
264
|
};
|
271
265
|
var createParallelWorkflow = function() {
|
272
266
|
var pipeline = createPipeline();
|
@@ -311,8 +305,7 @@ var isPromise = function(obj) {
|
|
311
305
|
return obj && typeof obj.then === "function";
|
312
306
|
};
|
313
307
|
var isAsyncWorkflow = function(input) {
|
314
|
-
|
315
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WORKFLOW_SYMBOL]);
|
308
|
+
return Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
|
316
309
|
};
|
317
310
|
var createAsyncWorkflow = function() {
|
318
311
|
var pipeline = createAsyncPipeline();
|
@@ -504,8 +497,7 @@ var generateRunner = function(hooksList, hooksMap) {
|
|
504
497
|
if (hooksMap) {
|
505
498
|
var _loop = function(key2) {
|
506
499
|
hooksList.forEach(function(hooks) {
|
507
|
-
|
508
|
-
if ((_hooks = hooks) === null || _hooks === void 0 ? void 0 : _hooks[key2]) {
|
500
|
+
if (hooks === null || hooks === void 0 ? void 0 : hooks[key2]) {
|
509
501
|
cloneShape[key2].use(hooks[key2]);
|
510
502
|
}
|
511
503
|
});
|
@@ -1,9 +1,6 @@
|
|
1
1
|
import { createContext } from "./context";
|
2
2
|
import { createCounter } from "./counter";
|
3
|
-
const isPipeline = (input) =>
|
4
|
-
var _input;
|
5
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PipelineSymbol]);
|
6
|
-
};
|
3
|
+
const isPipeline = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PipelineSymbol]);
|
7
4
|
const PipelineSymbol = Symbol.for("MODERN_PIPELINE");
|
8
5
|
const getMiddleware = (input) => {
|
9
6
|
if (typeof input === "function") {
|
@@ -32,11 +29,10 @@ const createPipeline = () => {
|
|
32
29
|
};
|
33
30
|
const currentCounter = createCurrentCounter();
|
34
31
|
const getCounter = (options) => {
|
35
|
-
var _options;
|
36
32
|
if (!options) {
|
37
33
|
return currentCounter;
|
38
34
|
}
|
39
|
-
return createCurrentCounter(
|
35
|
+
return createCurrentCounter(options === null || options === void 0 ? void 0 : options.onLast);
|
40
36
|
};
|
41
37
|
const run = (input, options) => getCounter(options).start(input);
|
42
38
|
const middleware = (input, next) => run(input, {
|
@@ -109,8 +109,7 @@ const generateRunner = (hooksList, hooksMap) => {
|
|
109
109
|
if (hooksMap) {
|
110
110
|
for (const key in cloneShape) {
|
111
111
|
hooksList.forEach((hooks) => {
|
112
|
-
|
113
|
-
if ((_hooks = hooks) === null || _hooks === void 0 ? void 0 : _hooks[key]) {
|
112
|
+
if (hooks === null || hooks === void 0 ? void 0 : hooks[key]) {
|
114
113
|
cloneShape[key].use(hooks[key]);
|
115
114
|
}
|
116
115
|
});
|
@@ -33,10 +33,7 @@ const createAsyncWaterfall = () => {
|
|
33
33
|
};
|
34
34
|
return waterfall;
|
35
35
|
};
|
36
|
-
const isAsyncWaterfall = (input) =>
|
37
|
-
var _input;
|
38
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WATERFALL_SYMBOL]);
|
39
|
-
};
|
36
|
+
const isAsyncWaterfall = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WATERFALL_SYMBOL]);
|
40
37
|
const mapAsyncBrookToAsyncMiddleware = (brook) => (input, next) => Promise.resolve(brook(input)).then((result) => next(result));
|
41
38
|
export {
|
42
39
|
createAsyncWaterfall,
|
@@ -32,10 +32,7 @@ const createWaterfall = () => {
|
|
32
32
|
};
|
33
33
|
return waterfall;
|
34
34
|
};
|
35
|
-
const isWaterfall = (input) =>
|
36
|
-
var _input;
|
37
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WATERFALL_SYMBOL]);
|
38
|
-
};
|
35
|
+
const isWaterfall = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WATERFALL_SYMBOL]);
|
39
36
|
const mapBrookToMiddleware = (brook) => (input, next) => next(brook(input));
|
40
37
|
export {
|
41
38
|
createWaterfall,
|
@@ -1,10 +1,7 @@
|
|
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
|
-
const isAsyncWorkflow = (input) =>
|
5
|
-
var _input;
|
6
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[ASYNC_WORKFLOW_SYMBOL]);
|
7
|
-
};
|
4
|
+
const isAsyncWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
|
8
5
|
const createAsyncWorkflow = () => {
|
9
6
|
const pipeline = createAsyncPipeline();
|
10
7
|
const use = (...input) => {
|
@@ -1,9 +1,6 @@
|
|
1
1
|
import { createPipeline } from "../farrow-pipeline";
|
2
2
|
const PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
|
3
|
-
const isParallelWorkflow = (input) =>
|
4
|
-
var _input;
|
5
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[PARALLEL_WORKFLOW_SYMBOL]);
|
6
|
-
};
|
3
|
+
const isParallelWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
|
7
4
|
const createParallelWorkflow = () => {
|
8
5
|
const pipeline = createPipeline();
|
9
6
|
const use = (...input) => {
|
@@ -20,10 +20,7 @@ const createWorkflow = () => {
|
|
20
20
|
};
|
21
21
|
return workflow;
|
22
22
|
};
|
23
|
-
const isWorkflow = (input) =>
|
24
|
-
var _input;
|
25
|
-
return Boolean((_input = input) === null || _input === void 0 ? void 0 : _input[WORKFLOW_SYMBOL]);
|
26
|
-
};
|
23
|
+
const isWorkflow = (input) => Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
|
27
24
|
const mapWorkerToMiddleware = (worker) => (input, next) => [
|
28
25
|
worker(input),
|
29
26
|
...next(input)
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "0.0.0-nightly-
|
18
|
+
"version": "0.0.0-nightly-20230927160620",
|
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": "0.0.0-nightly-
|
36
|
+
"@modern-js/utils": "0.0.0-nightly-20230927160620"
|
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": "0.0.0-nightly-
|
44
|
-
"@scripts/jest-config": "0.0.0-nightly-
|
43
|
+
"@scripts/build": "0.0.0-nightly-20230927160620",
|
44
|
+
"@scripts/jest-config": "0.0.0-nightly-20230927160620"
|
45
45
|
},
|
46
46
|
"sideEffects": false,
|
47
47
|
"publishConfig": {
|