@modern-js/plugin 2.19.0 → 2.20.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @modern-js/plugin
2
2
 
3
+ ## 2.20.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 6b9d90a: chore: remove @babel/runtime. add @swc/helper and enable `externalHelper` config.
8
+ chore: 移除 @babel/runtime 依赖. 增加 @swc/helpers 依赖并且开启 `externalHelpers` 配置
9
+ - Updated dependencies [3c4e0a5]
10
+ - Updated dependencies [6b9d90a]
11
+ - @modern-js/utils@2.20.0
12
+
13
+ ## 2.19.1
14
+
15
+ ### Patch Changes
16
+
17
+ - @modern-js/utils@2.19.1
18
+
3
19
  ## 2.19.0
4
20
 
5
21
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -2,20 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./farrow-pipeline"), exports);
6
- _export_star(require("./waterfall"), exports);
7
- _export_star(require("./workflow"), exports);
8
- _export_star(require("./manager"), exports);
9
- function _export_star(from, to) {
10
- Object.keys(from).forEach(function(k) {
11
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
12
- Object.defineProperty(to, k, {
13
- enumerable: true,
14
- get: function() {
15
- return from[k];
16
- }
17
- });
18
- }
19
- });
20
- return from;
21
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./farrow-pipeline"), exports);
7
+ _export_star._(require("./waterfall"), exports);
8
+ _export_star._(require("./workflow"), exports);
9
+ _export_star._(require("./manager"), exports);
@@ -2,19 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./sync"), exports);
6
- _export_star(require("./async"), exports);
7
- _export_star(require("./types"), exports);
8
- function _export_star(from, to) {
9
- Object.keys(from).forEach(function(k) {
10
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
11
- Object.defineProperty(to, k, {
12
- enumerable: true,
13
- get: function() {
14
- return from[k];
15
- }
16
- });
17
- }
18
- });
19
- return from;
20
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./sync"), exports);
7
+ _export_star._(require("./async"), exports);
8
+ _export_star._(require("./types"), exports);
@@ -2,18 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./sync"), exports);
6
- _export_star(require("./async"), exports);
7
- function _export_star(from, to) {
8
- Object.keys(from).forEach(function(k) {
9
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
10
- Object.defineProperty(to, k, {
11
- enumerable: true,
12
- get: function() {
13
- return from[k];
14
- }
15
- });
16
- }
17
- });
18
- return from;
19
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./sync"), exports);
7
+ _export_star._(require("./async"), exports);
@@ -2,19 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./sync"), exports);
6
- _export_star(require("./parallel"), exports);
7
- _export_star(require("./async"), exports);
8
- function _export_star(from, to) {
9
- Object.keys(from).forEach(function(k) {
10
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
11
- Object.defineProperty(to, k, {
12
- enumerable: true,
13
- get: function() {
14
- return from[k];
15
- }
16
- });
17
- }
18
- });
19
- return from;
20
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./sync"), exports);
7
+ _export_star._(require("./parallel"), exports);
8
+ _export_star._(require("./async"), exports);
package/dist/esm/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ // src/farrow-pipeline/index.ts
2
+ import { _ as _define_property } from "@swc/helpers/_/_define_property";
3
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
4
+ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
5
+
1
6
  // src/farrow-pipeline/context.ts
2
7
  var createContext = function(value) {
3
8
  var currentValue = value;
@@ -39,68 +44,6 @@ var createCounter = function(callback) {
39
44
  };
40
45
 
41
46
  // src/farrow-pipeline/index.ts
42
- function _array_like_to_array(arr, len) {
43
- if (len == null || len > arr.length)
44
- len = arr.length;
45
- for (var i = 0, arr2 = new Array(len); i < len; i++)
46
- arr2[i] = arr[i];
47
- return arr2;
48
- }
49
- function _array_without_holes(arr) {
50
- if (Array.isArray(arr))
51
- return _array_like_to_array(arr);
52
- }
53
- function _define_property(obj, key, value) {
54
- if (key in obj) {
55
- Object.defineProperty(obj, key, {
56
- value: value,
57
- enumerable: true,
58
- configurable: true,
59
- writable: true
60
- });
61
- } else {
62
- obj[key] = value;
63
- }
64
- return obj;
65
- }
66
- function _iterable_to_array(iter) {
67
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
68
- return Array.from(iter);
69
- }
70
- function _non_iterable_spread() {
71
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
72
- }
73
- function _object_spread(target) {
74
- for (var i = 1; i < arguments.length; i++) {
75
- var source = arguments[i] != null ? arguments[i] : {};
76
- var ownKeys8 = Object.keys(source);
77
- if (typeof Object.getOwnPropertySymbols === "function") {
78
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
79
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
80
- }));
81
- }
82
- ownKeys8.forEach(function(key) {
83
- _define_property(target, key, source[key]);
84
- });
85
- }
86
- return target;
87
- }
88
- function _to_consumable_array(arr) {
89
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
90
- }
91
- function _unsupported_iterable_to_array(o, minLen) {
92
- if (!o)
93
- return;
94
- if (typeof o === "string")
95
- return _array_like_to_array(o, minLen);
96
- var n = Object.prototype.toString.call(o).slice(8, -1);
97
- if (n === "Object" && o.constructor)
98
- n = o.constructor.name;
99
- if (n === "Map" || n === "Set")
100
- return Array.from(n);
101
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
102
- return _array_like_to_array(o, minLen);
103
- }
104
47
  var isPipeline = function(input) {
105
48
  return Boolean(input === null || input === void 0 ? void 0 : input[PipelineSymbol]);
106
49
  };
@@ -159,92 +102,10 @@ var createAsyncPipeline = function() {
159
102
  };
160
103
 
161
104
  // src/waterfall/sync.ts
162
- function _array_like_to_array2(arr, len) {
163
- if (len == null || len > arr.length)
164
- len = arr.length;
165
- for (var i = 0, arr2 = new Array(len); i < len; i++)
166
- arr2[i] = arr[i];
167
- return arr2;
168
- }
169
- function _array_without_holes2(arr) {
170
- if (Array.isArray(arr))
171
- return _array_like_to_array2(arr);
172
- }
173
- function _define_property2(obj, key, value) {
174
- if (key in obj) {
175
- Object.defineProperty(obj, key, {
176
- value: value,
177
- enumerable: true,
178
- configurable: true,
179
- writable: true
180
- });
181
- } else {
182
- obj[key] = value;
183
- }
184
- return obj;
185
- }
186
- function _iterable_to_array2(iter) {
187
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
188
- return Array.from(iter);
189
- }
190
- function _non_iterable_spread2() {
191
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
192
- }
193
- function _object_spread2(target) {
194
- for (var i = 1; i < arguments.length; i++) {
195
- var source = arguments[i] != null ? arguments[i] : {};
196
- var ownKeys8 = Object.keys(source);
197
- if (typeof Object.getOwnPropertySymbols === "function") {
198
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
199
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
200
- }));
201
- }
202
- ownKeys8.forEach(function(key) {
203
- _define_property2(target, key, source[key]);
204
- });
205
- }
206
- return target;
207
- }
208
- function ownKeys(object, enumerableOnly) {
209
- var keys = Object.keys(object);
210
- if (Object.getOwnPropertySymbols) {
211
- var symbols = Object.getOwnPropertySymbols(object);
212
- if (enumerableOnly) {
213
- symbols = symbols.filter(function(sym) {
214
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
215
- });
216
- }
217
- keys.push.apply(keys, symbols);
218
- }
219
- return keys;
220
- }
221
- function _object_spread_props(target, source) {
222
- source = source != null ? source : {};
223
- if (Object.getOwnPropertyDescriptors) {
224
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
225
- } else {
226
- ownKeys(Object(source)).forEach(function(key) {
227
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
228
- });
229
- }
230
- return target;
231
- }
232
- function _to_consumable_array2(arr) {
233
- return _array_without_holes2(arr) || _iterable_to_array2(arr) || _unsupported_iterable_to_array2(arr) || _non_iterable_spread2();
234
- }
235
- function _unsupported_iterable_to_array2(o, minLen) {
236
- if (!o)
237
- return;
238
- if (typeof o === "string")
239
- return _array_like_to_array2(o, minLen);
240
- var n = Object.prototype.toString.call(o).slice(8, -1);
241
- if (n === "Object" && o.constructor)
242
- n = o.constructor.name;
243
- if (n === "Map" || n === "Set")
244
- return Array.from(n);
245
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
246
- return _array_like_to_array2(o, minLen);
247
- }
105
+ import { _ as _define_property2 } from "@swc/helpers/_/_define_property";
106
+ import { _ as _object_spread2 } from "@swc/helpers/_/_object_spread";
107
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
108
+ import { _ as _to_consumable_array2 } from "@swc/helpers/_/_to_consumable_array";
248
109
  var WATERFALL_SYMBOL = Symbol.for("MODERN_WATERFALL");
249
110
  var getBrook = function(input) {
250
111
  if (typeof input === "function") {
@@ -295,92 +156,10 @@ var mapBrookToMiddleware = function(brook) {
295
156
  };
296
157
 
297
158
  // src/waterfall/async.ts
298
- function _array_like_to_array3(arr, len) {
299
- if (len == null || len > arr.length)
300
- len = arr.length;
301
- for (var i = 0, arr2 = new Array(len); i < len; i++)
302
- arr2[i] = arr[i];
303
- return arr2;
304
- }
305
- function _array_without_holes3(arr) {
306
- if (Array.isArray(arr))
307
- return _array_like_to_array3(arr);
308
- }
309
- function _define_property3(obj, key, value) {
310
- if (key in obj) {
311
- Object.defineProperty(obj, key, {
312
- value: value,
313
- enumerable: true,
314
- configurable: true,
315
- writable: true
316
- });
317
- } else {
318
- obj[key] = value;
319
- }
320
- return obj;
321
- }
322
- function _iterable_to_array3(iter) {
323
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
324
- return Array.from(iter);
325
- }
326
- function _non_iterable_spread3() {
327
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
328
- }
329
- function _object_spread3(target) {
330
- for (var i = 1; i < arguments.length; i++) {
331
- var source = arguments[i] != null ? arguments[i] : {};
332
- var ownKeys8 = Object.keys(source);
333
- if (typeof Object.getOwnPropertySymbols === "function") {
334
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
335
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
336
- }));
337
- }
338
- ownKeys8.forEach(function(key) {
339
- _define_property3(target, key, source[key]);
340
- });
341
- }
342
- return target;
343
- }
344
- function ownKeys2(object, enumerableOnly) {
345
- var keys = Object.keys(object);
346
- if (Object.getOwnPropertySymbols) {
347
- var symbols = Object.getOwnPropertySymbols(object);
348
- if (enumerableOnly) {
349
- symbols = symbols.filter(function(sym) {
350
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
351
- });
352
- }
353
- keys.push.apply(keys, symbols);
354
- }
355
- return keys;
356
- }
357
- function _object_spread_props2(target, source) {
358
- source = source != null ? source : {};
359
- if (Object.getOwnPropertyDescriptors) {
360
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
361
- } else {
362
- ownKeys2(Object(source)).forEach(function(key) {
363
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
364
- });
365
- }
366
- return target;
367
- }
368
- function _to_consumable_array3(arr) {
369
- return _array_without_holes3(arr) || _iterable_to_array3(arr) || _unsupported_iterable_to_array3(arr) || _non_iterable_spread3();
370
- }
371
- function _unsupported_iterable_to_array3(o, minLen) {
372
- if (!o)
373
- return;
374
- if (typeof o === "string")
375
- return _array_like_to_array3(o, minLen);
376
- var n = Object.prototype.toString.call(o).slice(8, -1);
377
- if (n === "Object" && o.constructor)
378
- n = o.constructor.name;
379
- if (n === "Map" || n === "Set")
380
- return Array.from(n);
381
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
382
- return _array_like_to_array3(o, minLen);
383
- }
159
+ import { _ as _define_property3 } from "@swc/helpers/_/_define_property";
160
+ import { _ as _object_spread3 } from "@swc/helpers/_/_object_spread";
161
+ import { _ as _object_spread_props2 } from "@swc/helpers/_/_object_spread_props";
162
+ import { _ as _to_consumable_array3 } from "@swc/helpers/_/_to_consumable_array";
384
163
  var ASYNC_WATERFALL_SYMBOL = Symbol.for("MODERN_ASYNC_WATERFALL");
385
164
  var getAsyncBrook = function(input) {
386
165
  if (typeof input === "function") {
@@ -434,92 +213,10 @@ var mapAsyncBrookToAsyncMiddleware = function(brook) {
434
213
  };
435
214
 
436
215
  // src/workflow/sync.ts
437
- function _array_like_to_array4(arr, len) {
438
- if (len == null || len > arr.length)
439
- len = arr.length;
440
- for (var i = 0, arr2 = new Array(len); i < len; i++)
441
- arr2[i] = arr[i];
442
- return arr2;
443
- }
444
- function _array_without_holes4(arr) {
445
- if (Array.isArray(arr))
446
- return _array_like_to_array4(arr);
447
- }
448
- function _define_property4(obj, key, value) {
449
- if (key in obj) {
450
- Object.defineProperty(obj, key, {
451
- value: value,
452
- enumerable: true,
453
- configurable: true,
454
- writable: true
455
- });
456
- } else {
457
- obj[key] = value;
458
- }
459
- return obj;
460
- }
461
- function _iterable_to_array4(iter) {
462
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
463
- return Array.from(iter);
464
- }
465
- function _non_iterable_spread4() {
466
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
467
- }
468
- function _object_spread4(target) {
469
- for (var i = 1; i < arguments.length; i++) {
470
- var source = arguments[i] != null ? arguments[i] : {};
471
- var ownKeys8 = Object.keys(source);
472
- if (typeof Object.getOwnPropertySymbols === "function") {
473
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
474
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
475
- }));
476
- }
477
- ownKeys8.forEach(function(key) {
478
- _define_property4(target, key, source[key]);
479
- });
480
- }
481
- return target;
482
- }
483
- function ownKeys3(object, enumerableOnly) {
484
- var keys = Object.keys(object);
485
- if (Object.getOwnPropertySymbols) {
486
- var symbols = Object.getOwnPropertySymbols(object);
487
- if (enumerableOnly) {
488
- symbols = symbols.filter(function(sym) {
489
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
490
- });
491
- }
492
- keys.push.apply(keys, symbols);
493
- }
494
- return keys;
495
- }
496
- function _object_spread_props3(target, source) {
497
- source = source != null ? source : {};
498
- if (Object.getOwnPropertyDescriptors) {
499
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
500
- } else {
501
- ownKeys3(Object(source)).forEach(function(key) {
502
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
503
- });
504
- }
505
- return target;
506
- }
507
- function _to_consumable_array4(arr) {
508
- return _array_without_holes4(arr) || _iterable_to_array4(arr) || _unsupported_iterable_to_array4(arr) || _non_iterable_spread4();
509
- }
510
- function _unsupported_iterable_to_array4(o, minLen) {
511
- if (!o)
512
- return;
513
- if (typeof o === "string")
514
- return _array_like_to_array4(o, minLen);
515
- var n = Object.prototype.toString.call(o).slice(8, -1);
516
- if (n === "Object" && o.constructor)
517
- n = o.constructor.name;
518
- if (n === "Map" || n === "Set")
519
- return Array.from(n);
520
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
521
- return _array_like_to_array4(o, minLen);
522
- }
216
+ import { _ as _define_property4 } from "@swc/helpers/_/_define_property";
217
+ import { _ as _object_spread4 } from "@swc/helpers/_/_object_spread";
218
+ import { _ as _object_spread_props3 } from "@swc/helpers/_/_object_spread_props";
219
+ import { _ as _to_consumable_array4 } from "@swc/helpers/_/_to_consumable_array";
523
220
  var WORKFLOW_SYMBOL = Symbol.for("MODERN_WORKFLOW");
524
221
  var createWorkflow = function() {
525
222
  var pipeline = createPipeline();
@@ -557,92 +254,10 @@ var mapWorkerToMiddleware = function(worker) {
557
254
  };
558
255
 
559
256
  // src/workflow/parallel.ts
560
- function _array_like_to_array5(arr, len) {
561
- if (len == null || len > arr.length)
562
- len = arr.length;
563
- for (var i = 0, arr2 = new Array(len); i < len; i++)
564
- arr2[i] = arr[i];
565
- return arr2;
566
- }
567
- function _array_without_holes5(arr) {
568
- if (Array.isArray(arr))
569
- return _array_like_to_array5(arr);
570
- }
571
- function _define_property5(obj, key, value) {
572
- if (key in obj) {
573
- Object.defineProperty(obj, key, {
574
- value: value,
575
- enumerable: true,
576
- configurable: true,
577
- writable: true
578
- });
579
- } else {
580
- obj[key] = value;
581
- }
582
- return obj;
583
- }
584
- function _iterable_to_array5(iter) {
585
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
586
- return Array.from(iter);
587
- }
588
- function _non_iterable_spread5() {
589
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
590
- }
591
- function _object_spread5(target) {
592
- for (var i = 1; i < arguments.length; i++) {
593
- var source = arguments[i] != null ? arguments[i] : {};
594
- var ownKeys8 = Object.keys(source);
595
- if (typeof Object.getOwnPropertySymbols === "function") {
596
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
597
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
598
- }));
599
- }
600
- ownKeys8.forEach(function(key) {
601
- _define_property5(target, key, source[key]);
602
- });
603
- }
604
- return target;
605
- }
606
- function ownKeys4(object, enumerableOnly) {
607
- var keys = Object.keys(object);
608
- if (Object.getOwnPropertySymbols) {
609
- var symbols = Object.getOwnPropertySymbols(object);
610
- if (enumerableOnly) {
611
- symbols = symbols.filter(function(sym) {
612
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
613
- });
614
- }
615
- keys.push.apply(keys, symbols);
616
- }
617
- return keys;
618
- }
619
- function _object_spread_props4(target, source) {
620
- source = source != null ? source : {};
621
- if (Object.getOwnPropertyDescriptors) {
622
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
623
- } else {
624
- ownKeys4(Object(source)).forEach(function(key) {
625
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
626
- });
627
- }
628
- return target;
629
- }
630
- function _to_consumable_array5(arr) {
631
- return _array_without_holes5(arr) || _iterable_to_array5(arr) || _unsupported_iterable_to_array5(arr) || _non_iterable_spread5();
632
- }
633
- function _unsupported_iterable_to_array5(o, minLen) {
634
- if (!o)
635
- return;
636
- if (typeof o === "string")
637
- return _array_like_to_array5(o, minLen);
638
- var n = Object.prototype.toString.call(o).slice(8, -1);
639
- if (n === "Object" && o.constructor)
640
- n = o.constructor.name;
641
- if (n === "Map" || n === "Set")
642
- return Array.from(n);
643
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
644
- return _array_like_to_array5(o, minLen);
645
- }
257
+ import { _ as _define_property5 } from "@swc/helpers/_/_define_property";
258
+ import { _ as _object_spread5 } from "@swc/helpers/_/_object_spread";
259
+ import { _ as _object_spread_props4 } from "@swc/helpers/_/_object_spread_props";
260
+ import { _ as _to_consumable_array5 } from "@swc/helpers/_/_to_consumable_array";
646
261
  var PARALLEL_WORKFLOW_SYMBOL = Symbol.for("MODERN_PARALLEL_WORKFLOW");
647
262
  var isParallelWorkflow = function(input) {
648
263
  return Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
@@ -681,92 +296,10 @@ var mapParallelWorkerToAsyncMiddleware = function(worker) {
681
296
  };
682
297
 
683
298
  // src/workflow/async.ts
684
- function _array_like_to_array6(arr, len) {
685
- if (len == null || len > arr.length)
686
- len = arr.length;
687
- for (var i = 0, arr2 = new Array(len); i < len; i++)
688
- arr2[i] = arr[i];
689
- return arr2;
690
- }
691
- function _array_without_holes6(arr) {
692
- if (Array.isArray(arr))
693
- return _array_like_to_array6(arr);
694
- }
695
- function _define_property6(obj, key, value) {
696
- if (key in obj) {
697
- Object.defineProperty(obj, key, {
698
- value: value,
699
- enumerable: true,
700
- configurable: true,
701
- writable: true
702
- });
703
- } else {
704
- obj[key] = value;
705
- }
706
- return obj;
707
- }
708
- function _iterable_to_array6(iter) {
709
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
710
- return Array.from(iter);
711
- }
712
- function _non_iterable_spread6() {
713
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
714
- }
715
- function _object_spread6(target) {
716
- for (var i = 1; i < arguments.length; i++) {
717
- var source = arguments[i] != null ? arguments[i] : {};
718
- var ownKeys8 = Object.keys(source);
719
- if (typeof Object.getOwnPropertySymbols === "function") {
720
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
721
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
722
- }));
723
- }
724
- ownKeys8.forEach(function(key) {
725
- _define_property6(target, key, source[key]);
726
- });
727
- }
728
- return target;
729
- }
730
- function ownKeys5(object, enumerableOnly) {
731
- var keys = Object.keys(object);
732
- if (Object.getOwnPropertySymbols) {
733
- var symbols = Object.getOwnPropertySymbols(object);
734
- if (enumerableOnly) {
735
- symbols = symbols.filter(function(sym) {
736
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
737
- });
738
- }
739
- keys.push.apply(keys, symbols);
740
- }
741
- return keys;
742
- }
743
- function _object_spread_props5(target, source) {
744
- source = source != null ? source : {};
745
- if (Object.getOwnPropertyDescriptors) {
746
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
747
- } else {
748
- ownKeys5(Object(source)).forEach(function(key) {
749
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
750
- });
751
- }
752
- return target;
753
- }
754
- function _to_consumable_array6(arr) {
755
- return _array_without_holes6(arr) || _iterable_to_array6(arr) || _unsupported_iterable_to_array6(arr) || _non_iterable_spread6();
756
- }
757
- function _unsupported_iterable_to_array6(o, minLen) {
758
- if (!o)
759
- return;
760
- if (typeof o === "string")
761
- return _array_like_to_array6(o, minLen);
762
- var n = Object.prototype.toString.call(o).slice(8, -1);
763
- if (n === "Object" && o.constructor)
764
- n = o.constructor.name;
765
- if (n === "Map" || n === "Set")
766
- return Array.from(n);
767
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
768
- return _array_like_to_array6(o, minLen);
769
- }
299
+ import { _ as _define_property6 } from "@swc/helpers/_/_define_property";
300
+ import { _ as _object_spread6 } from "@swc/helpers/_/_object_spread";
301
+ import { _ as _object_spread_props5 } from "@swc/helpers/_/_object_spread_props";
302
+ import { _ as _to_consumable_array6 } from "@swc/helpers/_/_to_consumable_array";
770
303
  var ASYNC_WORKFLOW_SYMBOL = Symbol.for("MODERN_ASYNC_WORKFLOW");
771
304
  var isAsyncWorkflow = function(input) {
772
305
  return Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
@@ -815,6 +348,10 @@ function isPromise(obj) {
815
348
  return obj && typeof obj.then === "function";
816
349
  }
817
350
 
351
+ // src/manager/sync.ts
352
+ import { _ as _object_spread7 } from "@swc/helpers/_/_object_spread";
353
+ import { _ as _object_spread_props6 } from "@swc/helpers/_/_object_spread_props";
354
+
818
355
  // src/manager/shared.ts
819
356
  import { pluginDagSort } from "@modern-js/utils/universal/plugin-dag-sort";
820
357
  var checkPlugins = function(plugins) {
@@ -853,58 +390,6 @@ var hasOwnProperty = function(obj, prop) {
853
390
  };
854
391
 
855
392
  // src/manager/sync.ts
856
- function _define_property7(obj, key, value) {
857
- if (key in obj) {
858
- Object.defineProperty(obj, key, {
859
- value: value,
860
- enumerable: true,
861
- configurable: true,
862
- writable: true
863
- });
864
- } else {
865
- obj[key] = value;
866
- }
867
- return obj;
868
- }
869
- function _object_spread7(target) {
870
- for (var i = 1; i < arguments.length; i++) {
871
- var source = arguments[i] != null ? arguments[i] : {};
872
- var ownKeys8 = Object.keys(source);
873
- if (typeof Object.getOwnPropertySymbols === "function") {
874
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
875
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
876
- }));
877
- }
878
- ownKeys8.forEach(function(key) {
879
- _define_property7(target, key, source[key]);
880
- });
881
- }
882
- return target;
883
- }
884
- function ownKeys6(object, enumerableOnly) {
885
- var keys = Object.keys(object);
886
- if (Object.getOwnPropertySymbols) {
887
- var symbols = Object.getOwnPropertySymbols(object);
888
- if (enumerableOnly) {
889
- symbols = symbols.filter(function(sym) {
890
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
891
- });
892
- }
893
- keys.push.apply(keys, symbols);
894
- }
895
- return keys;
896
- }
897
- function _object_spread_props6(target, source) {
898
- source = source != null ? source : {};
899
- if (Object.getOwnPropertyDescriptors) {
900
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
901
- } else {
902
- ownKeys6(Object(source)).forEach(function(key) {
903
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
904
- });
905
- }
906
- return target;
907
- }
908
393
  var SYNC_PLUGIN_SYMBOL = "SYNC_PLUGIN_SYMBOL";
909
394
  var DEFAULT_OPTIONS = {
910
395
  name: "untitled",
@@ -1058,58 +543,8 @@ var cloneHooksMap = function(record) {
1058
543
  };
1059
544
 
1060
545
  // src/manager/async.ts
1061
- function _define_property8(obj, key, value) {
1062
- if (key in obj) {
1063
- Object.defineProperty(obj, key, {
1064
- value: value,
1065
- enumerable: true,
1066
- configurable: true,
1067
- writable: true
1068
- });
1069
- } else {
1070
- obj[key] = value;
1071
- }
1072
- return obj;
1073
- }
1074
- function _object_spread8(target) {
1075
- for (var i = 1; i < arguments.length; i++) {
1076
- var source = arguments[i] != null ? arguments[i] : {};
1077
- var ownKeys8 = Object.keys(source);
1078
- if (typeof Object.getOwnPropertySymbols === "function") {
1079
- ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1080
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1081
- }));
1082
- }
1083
- ownKeys8.forEach(function(key) {
1084
- _define_property8(target, key, source[key]);
1085
- });
1086
- }
1087
- return target;
1088
- }
1089
- function ownKeys7(object, enumerableOnly) {
1090
- var keys = Object.keys(object);
1091
- if (Object.getOwnPropertySymbols) {
1092
- var symbols = Object.getOwnPropertySymbols(object);
1093
- if (enumerableOnly) {
1094
- symbols = symbols.filter(function(sym) {
1095
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1096
- });
1097
- }
1098
- keys.push.apply(keys, symbols);
1099
- }
1100
- return keys;
1101
- }
1102
- function _object_spread_props7(target, source) {
1103
- source = source != null ? source : {};
1104
- if (Object.getOwnPropertyDescriptors) {
1105
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1106
- } else {
1107
- ownKeys7(Object(source)).forEach(function(key) {
1108
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1109
- });
1110
- }
1111
- return target;
1112
- }
546
+ import { _ as _object_spread8 } from "@swc/helpers/_/_object_spread";
547
+ import { _ as _object_spread_props7 } from "@swc/helpers/_/_object_spread_props";
1113
548
  var ASYNC_PLUGIN_SYMBOL = "ASYNC_PLUGIN_SYMBOL";
1114
549
  var createAsyncManager = function(hooks, api) {
1115
550
  var index = 0;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.19.0",
18
+ "version": "2.20.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -32,16 +32,16 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@babel/runtime": "^7.18.0",
36
- "@modern-js/utils": "2.19.0"
35
+ "@swc/helpers": "0.5.1",
36
+ "@modern-js/utils": "2.20.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "^29",
40
40
  "@types/node": "^14",
41
41
  "typescript": "^4",
42
42
  "jest": "^29",
43
- "@scripts/build": "2.19.0",
44
- "@scripts/jest-config": "2.19.0"
43
+ "@scripts/build": "2.20.0",
44
+ "@scripts/jest-config": "2.20.0"
45
45
  },
46
46
  "sideEffects": false,
47
47
  "publishConfig": {