@nlozgachev/pipelined 0.41.0 → 0.43.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.
@@ -2,13 +2,73 @@ import {
2
2
  Deferred,
3
3
  Maybe,
4
4
  Result,
5
- Task
6
- } from "./chunk-COGQKPIP.mjs";
7
- import {
8
- isNonEmptyList
9
- } from "./chunk-GBB6LVLI.mjs";
5
+ Task,
6
+ isNonEmptyArr
7
+ } from "./chunk-CHRXZIJU.mjs";
10
8
 
11
9
  // src/Data/Arr.ts
10
+ var ArrMaybe;
11
+ ((ArrMaybe2) => {
12
+ ArrMaybe2.traverse = (f) => (data) => {
13
+ const n = data.length;
14
+ const result = new Array(n);
15
+ for (let i = 0; i < n; i++) {
16
+ const mapped = f(data[i]);
17
+ if (mapped.kind === "None") {
18
+ return Maybe.none();
19
+ }
20
+ result[i] = mapped.value;
21
+ }
22
+ return Maybe.some(result);
23
+ };
24
+ ArrMaybe2.sequence = (data) => (0, ArrMaybe2.traverse)((a) => a)(data);
25
+ })(ArrMaybe || (ArrMaybe = {}));
26
+ var ArrResult;
27
+ ((ArrResult2) => {
28
+ ArrResult2.traverse = (f) => (data) => {
29
+ const n = data.length;
30
+ const result = new Array(n);
31
+ for (let i = 0; i < n; i++) {
32
+ const mapped = f(data[i]);
33
+ if (mapped.kind === "Err") {
34
+ return mapped;
35
+ }
36
+ result[i] = mapped.value;
37
+ }
38
+ return Result.ok(result);
39
+ };
40
+ ArrResult2.sequence = (data) => (0, ArrResult2.traverse)((a) => a)(data);
41
+ })(ArrResult || (ArrResult = {}));
42
+ var ArrTaskResult;
43
+ ((ArrTaskResult2) => {
44
+ ArrTaskResult2.traverse = (f) => (data) => Task.from(async () => {
45
+ const result = [];
46
+ for (const a of data) {
47
+ const r = await Deferred.toPromise(f(a)());
48
+ if (Result.isErr(r)) {
49
+ return r;
50
+ }
51
+ result.push(r.value);
52
+ }
53
+ return Result.ok(result);
54
+ });
55
+ ArrTaskResult2.sequence = (data) => (0, ArrTaskResult2.traverse)((a) => a)(data);
56
+ })(ArrTaskResult || (ArrTaskResult = {}));
57
+ var ArrTask;
58
+ ((ArrTask2) => {
59
+ ArrTask2.traverse = (f) => (data) => Task.from(() => Promise.all(data.map((a) => Deferred.toPromise(f(a)()))));
60
+ ArrTask2.sequence = (data) => (0, ArrTask2.traverse)((a) => a)(data);
61
+ ArrTask2.Result = ArrTaskResult;
62
+ })(ArrTask || (ArrTask = {}));
63
+ var ArrNonEmpty;
64
+ ((ArrNonEmpty2) => {
65
+ ArrNonEmpty2.singleton = (value) => [value];
66
+ ArrNonEmpty2.fromArray = (data) => isNonEmptyArr(data) ? Maybe.some(data) : Maybe.none();
67
+ ArrNonEmpty2.head = (data) => data[0];
68
+ ArrNonEmpty2.last = (data) => data[data.length - 1];
69
+ ArrNonEmpty2.tail = (data) => data.slice(1);
70
+ ArrNonEmpty2.reduce = (f) => (data) => data.reduce(f);
71
+ })(ArrNonEmpty || (ArrNonEmpty = {}));
12
72
  var Arr;
13
73
  ((Arr2) => {
14
74
  Arr2.head = (data) => data.length > 0 ? Maybe.some(data[0]) : Maybe.none();
@@ -182,6 +242,7 @@ var Arr;
182
242
  }
183
243
  return result;
184
244
  };
245
+ Arr2.concat = (other) => (data) => [...data, ...other];
185
246
  Arr2.chunksOf = (n) => (data) => {
186
247
  if (n <= 0) {
187
248
  return [];
@@ -222,47 +283,12 @@ var Arr;
222
283
  return result;
223
284
  };
224
285
  Arr2.reduce = (initial, f) => (data) => data.reduce(f, initial);
225
- Arr2.traverse = (f) => (data) => {
226
- const n = data.length;
227
- const result = new Array(n);
228
- for (let i = 0; i < n; i++) {
229
- const mapped = f(data[i]);
230
- if (mapped.kind === "None") {
231
- return Maybe.none();
232
- }
233
- result[i] = mapped.value;
234
- }
235
- return Maybe.some(result);
236
- };
237
- Arr2.traverseResult = (f) => (data) => {
238
- const n = data.length;
239
- const result = new Array(n);
240
- for (let i = 0; i < n; i++) {
241
- const mapped = f(data[i]);
242
- if (mapped.kind === "Err") {
243
- return mapped;
244
- }
245
- result[i] = mapped.value;
246
- }
247
- return Result.ok(result);
248
- };
249
- Arr2.traverseTask = (f) => (data) => Task.from(() => Promise.all(data.map((a) => Deferred.toPromise(f(a)()))));
250
- Arr2.sequence = (data) => (0, Arr2.traverse)((a) => a)(data);
251
- Arr2.sequenceResult = (data) => (0, Arr2.traverseResult)((a) => a)(data);
252
- Arr2.sequenceTask = (data) => (0, Arr2.traverseTask)((a) => a)(data);
253
- Arr2.traverseTaskResult = (f) => (data) => Task.from(async () => {
254
- const result = [];
255
- for (const a of data) {
256
- const r = await Deferred.toPromise(f(a)());
257
- if (Result.isErr(r)) {
258
- return r;
259
- }
260
- result.push(r.value);
261
- }
262
- return Result.ok(result);
263
- });
264
- Arr2.sequenceTaskResult = (data) => (0, Arr2.traverseTaskResult)((a) => a)(data);
265
- Arr2.isNonEmpty = (data) => isNonEmptyList(data);
286
+ Arr2.Maybe = ArrMaybe;
287
+ Arr2.Result = ArrResult;
288
+ Arr2.Task = ArrTask;
289
+ Arr2.isNonEmpty = (data) => isNonEmptyArr(data);
290
+ Arr2.prepend = (value) => (data) => [value, ...data];
291
+ Arr2.append = (value) => (data) => [...data, value];
266
292
  Arr2.size = (data) => data.length;
267
293
  Arr2.some = (predicate) => (data) => {
268
294
  const n = data.length;
@@ -338,6 +364,7 @@ var Arr;
338
364
  const i = Math.max(0, index);
339
365
  return [data.slice(0, i), data.slice(i)];
340
366
  };
367
+ Arr2.NonEmpty = ArrNonEmpty;
341
368
  })(Arr || (Arr = {}));
342
369
 
343
370
  // src/Data/Dict.ts
@@ -547,25 +574,78 @@ var Num;
547
574
  })(Num || (Num = {}));
548
575
 
549
576
  // src/Data/Rec.ts
577
+ var _isNonEmpty = (data) => Object.keys(data).length > 0;
578
+ var RecMaybe;
579
+ ((RecMaybe2) => {
580
+ RecMaybe2.traverse = (f) => (data) => {
581
+ const recordKeys = Object.keys(data);
582
+ const result = {};
583
+ for (let i = 0; i < recordKeys.length; i++) {
584
+ const key = recordKeys[i];
585
+ const maybeVal = f(data[key]);
586
+ if (maybeVal.kind === "None") {
587
+ return maybeVal;
588
+ }
589
+ Object.defineProperty(result, key, { value: maybeVal.value, writable: true, enumerable: true, configurable: true });
590
+ }
591
+ return { kind: "Some", value: result };
592
+ };
593
+ RecMaybe2.sequence = (data) => (0, RecMaybe2.traverse)((a) => a)(data);
594
+ })(RecMaybe || (RecMaybe = {}));
595
+ var RecResult;
596
+ ((RecResult2) => {
597
+ RecResult2.traverse = (f) => (data) => {
598
+ const recordKeys = Object.keys(data);
599
+ const result = {};
600
+ for (let i = 0; i < recordKeys.length; i++) {
601
+ const key = recordKeys[i];
602
+ const res = f(data[key]);
603
+ if (res.kind === "Err") {
604
+ return res;
605
+ }
606
+ Object.defineProperty(result, key, { value: res.value, writable: true, enumerable: true, configurable: true });
607
+ }
608
+ return { kind: "Ok", value: result };
609
+ };
610
+ RecResult2.sequence = (data) => (0, RecResult2.traverse)((a) => a)(data);
611
+ })(RecResult || (RecResult = {}));
612
+ var RecNonEmpty;
613
+ ((RecNonEmpty2) => {
614
+ RecNonEmpty2.singleton = (key, value) => ({ [key]: value });
615
+ RecNonEmpty2.fromRecord = (data) => _isNonEmpty(data) ? Maybe.some(data) : Maybe.none();
616
+ RecNonEmpty2.keys = (data) => Object.keys(data);
617
+ RecNonEmpty2.values = (data) => Object.values(data);
618
+ RecNonEmpty2.entries = (data) => Object.entries(data);
619
+ RecNonEmpty2.reduce = (f) => (data) => {
620
+ const recordVals = Object.values(data);
621
+ return recordVals.reduce(f);
622
+ };
623
+ })(RecNonEmpty || (RecNonEmpty = {}));
550
624
  var Rec;
551
625
  ((Rec2) => {
552
- Rec2.map = (f) => (data) => {
553
- const keys2 = Object.keys(data);
554
- const vals = Object.values(data);
626
+ Rec2.isNonEmpty = _isNonEmpty;
627
+ Rec2.map = (f) => ((data) => {
628
+ const recordKeys = Object.keys(data);
629
+ const recordValues = Object.values(data);
555
630
  const result = Object.create(Object.getPrototypeOf(data));
556
- for (let i = 0; i < keys2.length; i++) {
557
- Object.defineProperty(result, keys2[i], { value: f(vals[i]), writable: true, enumerable: true, configurable: true });
631
+ for (let i = 0; i < recordKeys.length; i++) {
632
+ Object.defineProperty(result, recordKeys[i], {
633
+ value: f(recordValues[i]),
634
+ writable: true,
635
+ enumerable: true,
636
+ configurable: true
637
+ });
558
638
  }
559
639
  return result;
560
- };
640
+ });
561
641
  Rec2.filterMap = (f) => (data) => {
562
- const keys2 = Object.keys(data);
563
- const vals = Object.values(data);
642
+ const recordKeys = Object.keys(data);
643
+ const recordValues = Object.values(data);
564
644
  const result = Object.create(Object.getPrototypeOf(data));
565
- for (let i = 0; i < keys2.length; i++) {
566
- const maybeVal = f(vals[i]);
645
+ for (let i = 0; i < recordKeys.length; i++) {
646
+ const maybeVal = f(recordValues[i]);
567
647
  if (maybeVal.kind === "Some") {
568
- Object.defineProperty(result, keys2[i], {
648
+ Object.defineProperty(result, recordKeys[i], {
569
649
  value: maybeVal.value,
570
650
  writable: true,
571
651
  enumerable: true,
@@ -575,27 +655,32 @@ var Rec;
575
655
  }
576
656
  return result;
577
657
  };
578
- Rec2.mapWithKey = (f) => (data) => {
579
- const keys2 = Object.keys(data);
580
- const vals = Object.values(data);
658
+ Rec2.mapWithKey = (f) => ((data) => {
659
+ const recordKeys = Object.keys(data);
660
+ const recordValues = Object.values(data);
581
661
  const result = Object.create(Object.getPrototypeOf(data));
582
- for (let i = 0; i < keys2.length; i++) {
583
- Object.defineProperty(result, keys2[i], {
584
- value: f(keys2[i], vals[i]),
662
+ for (let i = 0; i < recordKeys.length; i++) {
663
+ Object.defineProperty(result, recordKeys[i], {
664
+ value: f(recordKeys[i], recordValues[i]),
585
665
  writable: true,
586
666
  enumerable: true,
587
667
  configurable: true
588
668
  });
589
669
  }
590
670
  return result;
591
- };
671
+ });
592
672
  Rec2.filter = (predicate) => (data) => {
593
- const keys2 = Object.keys(data);
594
- const vals = Object.values(data);
673
+ const recordKeys = Object.keys(data);
674
+ const recordValues = Object.values(data);
595
675
  const result = Object.create(Object.getPrototypeOf(data));
596
- for (let i = 0; i < keys2.length; i++) {
597
- if (predicate(vals[i])) {
598
- Object.defineProperty(result, keys2[i], { value: vals[i], writable: true, enumerable: true, configurable: true });
676
+ for (let i = 0; i < recordKeys.length; i++) {
677
+ if (predicate(recordValues[i])) {
678
+ Object.defineProperty(result, recordKeys[i], {
679
+ value: recordValues[i],
680
+ writable: true,
681
+ enumerable: true,
682
+ configurable: true
683
+ });
599
684
  }
600
685
  }
601
686
  return result;
@@ -672,6 +757,9 @@ var Rec;
672
757
  }
673
758
  return result;
674
759
  };
760
+ Rec2.Maybe = RecMaybe;
761
+ Rec2.Result = RecResult;
762
+ Rec2.NonEmpty = RecNonEmpty;
675
763
  })(Rec || (Rec = {}));
676
764
 
677
765
  // src/Data/Str.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Duration
3
- } from "./chunk-GBB6LVLI.mjs";
3
+ } from "./chunk-74JKKJ4R.mjs";
4
4
 
5
5
  // src/Composition/compose.ts
6
6
  function compose(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9) {
@@ -368,7 +368,7 @@ function tap(f) {
368
368
  };
369
369
  tap2.async = (fn, options) => (a) => {
370
370
  const onError = options?.onError ?? console.error;
371
- fn(a).catch((err) => {
371
+ Promise.resolve(fn(a)).catch((err) => {
372
372
  onError(err);
373
373
  });
374
374
  return a;
@@ -378,13 +378,13 @@ function tap(f) {
378
378
  const triggerFinish = (duration) => {
379
379
  if (config.label !== void 0) {
380
380
  console.log(`[${config.label}]: ${Duration.toMilliseconds(duration)}ms`);
381
- } else if (config.onFinish) {
381
+ } else {
382
382
  config.onFinish(duration);
383
383
  }
384
384
  };
385
385
  try {
386
386
  const res = fn(a);
387
- if (res instanceof Promise) {
387
+ if (res !== null && (typeof res === "object" || typeof res === "function") && typeof res.then === "function") {
388
388
  res.then(() => {
389
389
  const duration = Duration.milliseconds(performance.now() - start);
390
390
  triggerFinish(duration);
@@ -1,4 +1,5 @@
1
- import { D as Duration } from './Duration-BTeT9D-q.mjs';
1
+ import { A as Awaitable, T as Thenable } from './InternalTypes-DsCqxWZm.mjs';
2
+ import { Duration } from './types.mjs';
2
3
 
3
4
  /**
4
5
  * Composes functions from right to left, returning a new function.
@@ -132,16 +133,16 @@ declare function safe$1<A, B, C, D, E, F, G, H>(ab: (a: NonNullable<A>) => B, bc
132
133
  declare function safe$1<A, B, C, D, E, F, G, H, I>(ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I): (a: A) => I | Extract<A | B | C | D | E | F | G | H, null | undefined>;
133
134
  declare function safe$1<A, B, C, D, E, F, G, H, I, J>(ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I, ij: (i: NonNullable<I>) => J): (a: A) => J | Extract<A | B | C | D | E | F | G | H | I, null | undefined>;
134
135
  declare function safe$1<A, B, C, D, E, F, G, H, I, J, K>(ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I, ij: (i: NonNullable<I>) => J, jk: (j: J) => K): (a: A) => K | Extract<A | B | C | D | E | F | G | H | I | J, null | undefined>;
135
- declare function async$1<A, B>(ab: (a: A) => B | Promise<B>): (a: A | Promise<A>) => Promise<B>;
136
- declare function async$1<A, B, C>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>): (a: A | Promise<A>) => Promise<C>;
137
- declare function async$1<A, B, C, D>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>): (a: A | Promise<A>) => Promise<D>;
138
- declare function async$1<A, B, C, D, E>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>): (a: A | Promise<A>) => Promise<E>;
139
- declare function async$1<A, B, C, D, E, F>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>): (a: A | Promise<A>) => Promise<F>;
140
- declare function async$1<A, B, C, D, E, F, G>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>): (a: A | Promise<A>) => Promise<G>;
141
- declare function async$1<A, B, C, D, E, F, G, H>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>): (a: A | Promise<A>) => Promise<H>;
142
- declare function async$1<A, B, C, D, E, F, G, H, I>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>): (a: A | Promise<A>) => Promise<I>;
143
- declare function async$1<A, B, C, D, E, F, G, H, I, J>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J): (a: A | Promise<A>) => Promise<J>;
144
- declare function async$1<A, B, C, D, E, F, G, H, I, J, K>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J | Promise<J>, jk: (j: J) => K | Promise<K>): (a: A | Promise<A>) => Promise<K>;
136
+ declare function async$1<A, B>(ab: (a: A) => Awaitable<B>): (a: Awaitable<A>) => Promise<B>;
137
+ declare function async$1<A, B, C>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>): (a: Awaitable<A>) => Promise<C>;
138
+ declare function async$1<A, B, C, D>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>): (a: Awaitable<A>) => Promise<D>;
139
+ declare function async$1<A, B, C, D, E>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>): (a: Awaitable<A>) => Promise<E>;
140
+ declare function async$1<A, B, C, D, E, F>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>): (a: Awaitable<A>) => Promise<F>;
141
+ declare function async$1<A, B, C, D, E, F, G>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>): (a: Awaitable<A>) => Promise<G>;
142
+ declare function async$1<A, B, C, D, E, F, G, H>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>): (a: Awaitable<A>) => Promise<H>;
143
+ declare function async$1<A, B, C, D, E, F, G, H, I>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>): (a: Awaitable<A>) => Promise<I>;
144
+ declare function async$1<A, B, C, D, E, F, G, H, I, J>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => J): (a: Awaitable<A>) => Promise<J>;
145
+ declare function async$1<A, B, C, D, E, F, G, H, I, J, K>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => Awaitable<J>, jk: (j: J) => Awaitable<K>): (a: Awaitable<A>) => Promise<K>;
145
146
  /**
146
147
  * Composes functions from left to right, returning a new function.
147
148
  * Unlike `pipe`, `flow` doesn't take an initial value - it creates
@@ -210,16 +211,16 @@ declare namespace flow {
210
211
  <A, B, C, D, E, F, G, H, I, J, K>(ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I, ij: (i: NonNullable<I>) => J, jk: (j: J) => K): (a: A) => K | Extract<A | B | C | D | E | F | G | H | I | J, null | undefined>;
211
212
  };
212
213
  export var async: {
213
- <A, B>(ab: (a: A) => B | Promise<B>): (a: A | Promise<A>) => Promise<B>;
214
- <A, B, C>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>): (a: A | Promise<A>) => Promise<C>;
215
- <A, B, C, D>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>): (a: A | Promise<A>) => Promise<D>;
216
- <A, B, C, D, E>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>): (a: A | Promise<A>) => Promise<E>;
217
- <A, B, C, D, E, F>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>): (a: A | Promise<A>) => Promise<F>;
218
- <A, B, C, D, E, F, G>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>): (a: A | Promise<A>) => Promise<G>;
219
- <A, B, C, D, E, F, G, H>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>): (a: A | Promise<A>) => Promise<H>;
220
- <A, B, C, D, E, F, G, H, I>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>): (a: A | Promise<A>) => Promise<I>;
221
- <A, B, C, D, E, F, G, H, I, J>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J): (a: A | Promise<A>) => Promise<J>;
222
- <A, B, C, D, E, F, G, H, I, J, K>(ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J | Promise<J>, jk: (j: J) => K | Promise<K>): (a: A | Promise<A>) => Promise<K>;
214
+ <A, B>(ab: (a: A) => Awaitable<B>): (a: Awaitable<A>) => Promise<B>;
215
+ <A, B, C>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>): (a: Awaitable<A>) => Promise<C>;
216
+ <A, B, C, D>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>): (a: Awaitable<A>) => Promise<D>;
217
+ <A, B, C, D, E>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>): (a: Awaitable<A>) => Promise<E>;
218
+ <A, B, C, D, E, F>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>): (a: Awaitable<A>) => Promise<F>;
219
+ <A, B, C, D, E, F, G>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>): (a: Awaitable<A>) => Promise<G>;
220
+ <A, B, C, D, E, F, G, H>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>): (a: Awaitable<A>) => Promise<H>;
221
+ <A, B, C, D, E, F, G, H, I>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>): (a: Awaitable<A>) => Promise<I>;
222
+ <A, B, C, D, E, F, G, H, I, J>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => J): (a: Awaitable<A>) => Promise<J>;
223
+ <A, B, C, D, E, F, G, H, I, J, K>(ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => Awaitable<J>, jk: (j: J) => Awaitable<K>): (a: Awaitable<A>) => Promise<K>;
223
224
  };
224
225
  var _a: <A, B, C>(f: (a: A) => B, onError: (error: unknown, value: A) => C) => (a: A) => B | C;
225
226
  export { _a as try };
@@ -462,17 +463,17 @@ declare function safe<A, B, C, D, E, F, G, H>(a: A, ab: (a: NonNullable<A>) => B
462
463
  declare function safe<A, B, C, D, E, F, G, H, I>(a: A, ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I): I | Extract<A | B | C | D | E | F | G | H, null | undefined>;
463
464
  declare function safe<A, B, C, D, E, F, G, H, I, J>(a: A, ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I, ij: (i: NonNullable<I>) => J): J | Extract<A | B | C | D | E | F | G | H | I, null | undefined>;
464
465
  declare function safe<A, B, C, D, E, F, G, H, I, J, K>(a: A, ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I, ij: (i: NonNullable<I>) => J, jk: (j: J) => K): K | Extract<A | B | C | D | E | F | G | H | I | J, null | undefined>;
465
- declare function async<A>(a: A | Promise<A>): Promise<A>;
466
- declare function async<A, B>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>): Promise<B>;
467
- declare function async<A, B, C>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>): Promise<C>;
468
- declare function async<A, B, C, D>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>): Promise<D>;
469
- declare function async<A, B, C, D, E>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>): Promise<E>;
470
- declare function async<A, B, C, D, E, F>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>): Promise<F>;
471
- declare function async<A, B, C, D, E, F, G>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>): Promise<G>;
472
- declare function async<A, B, C, D, E, F, G, H>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>): Promise<H>;
473
- declare function async<A, B, C, D, E, F, G, H, I>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>): Promise<I>;
474
- declare function async<A, B, C, D, E, F, G, H, I, J>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J): Promise<J>;
475
- declare function async<A, B, C, D, E, F, G, H, I, J, K>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J | Promise<J>, jk: (j: J) => K | Promise<K>): Promise<K>;
466
+ declare function async<A>(a: Awaitable<A>): Promise<A>;
467
+ declare function async<A, B>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>): Promise<B>;
468
+ declare function async<A, B, C>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>): Promise<C>;
469
+ declare function async<A, B, C, D>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>): Promise<D>;
470
+ declare function async<A, B, C, D, E>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>): Promise<E>;
471
+ declare function async<A, B, C, D, E, F>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>): Promise<F>;
472
+ declare function async<A, B, C, D, E, F, G>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>): Promise<G>;
473
+ declare function async<A, B, C, D, E, F, G, H>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>): Promise<H>;
474
+ declare function async<A, B, C, D, E, F, G, H, I>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>): Promise<I>;
475
+ declare function async<A, B, C, D, E, F, G, H, I, J>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => J): Promise<J>;
476
+ declare function async<A, B, C, D, E, F, G, H, I, J, K>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => Awaitable<J>, jk: (j: J) => Awaitable<K>): Promise<K>;
476
477
  /**
477
478
  * Pipes a value through a series of functions from left to right.
478
479
  * Each function receives the output of the previous function.
@@ -541,17 +542,17 @@ declare namespace pipe {
541
542
  <A, B, C, D, E, F, G, H, I, J, K>(a: A, ab: (a: NonNullable<A>) => B, bc: (b: NonNullable<B>) => C, cd: (c: NonNullable<C>) => D, de: (d: NonNullable<D>) => E, ef: (e: NonNullable<E>) => F, fg: (f: NonNullable<F>) => G, gh: (g: NonNullable<G>) => H, hi: (h: NonNullable<H>) => I, ij: (i: NonNullable<I>) => J, jk: (j: J) => K): K | Extract<A | B | C | D | E | F | G | H | I | J, null | undefined>;
542
543
  };
543
544
  export var async: {
544
- <A>(a: A | Promise<A>): Promise<A>;
545
- <A, B>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>): Promise<B>;
546
- <A, B, C>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>): Promise<C>;
547
- <A, B, C, D>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>): Promise<D>;
548
- <A, B, C, D, E>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>): Promise<E>;
549
- <A, B, C, D, E, F>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>): Promise<F>;
550
- <A, B, C, D, E, F, G>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>): Promise<G>;
551
- <A, B, C, D, E, F, G, H>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>): Promise<H>;
552
- <A, B, C, D, E, F, G, H, I>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>): Promise<I>;
553
- <A, B, C, D, E, F, G, H, I, J>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J): Promise<J>;
554
- <A, B, C, D, E, F, G, H, I, J, K>(a: A | Promise<A>, ab: (a: A) => B | Promise<B>, bc: (b: B) => C | Promise<C>, cd: (c: C) => D | Promise<D>, de: (d: D) => E | Promise<E>, ef: (e: E) => F | Promise<F>, fg: (f: F) => G | Promise<G>, gh: (g: G) => H | Promise<H>, hi: (h: H) => I | Promise<I>, ij: (i: I) => J | Promise<J>, jk: (j: J) => K | Promise<K>): Promise<K>;
545
+ <A>(a: Awaitable<A>): Promise<A>;
546
+ <A, B>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>): Promise<B>;
547
+ <A, B, C>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>): Promise<C>;
548
+ <A, B, C, D>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>): Promise<D>;
549
+ <A, B, C, D, E>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>): Promise<E>;
550
+ <A, B, C, D, E, F>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>): Promise<F>;
551
+ <A, B, C, D, E, F, G>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>): Promise<G>;
552
+ <A, B, C, D, E, F, G, H>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>): Promise<H>;
553
+ <A, B, C, D, E, F, G, H, I>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>): Promise<I>;
554
+ <A, B, C, D, E, F, G, H, I, J>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => J): Promise<J>;
555
+ <A, B, C, D, E, F, G, H, I, J, K>(a: Awaitable<A>, ab: (a: A) => Awaitable<B>, bc: (b: B) => Awaitable<C>, cd: (c: C) => Awaitable<D>, de: (d: D) => Awaitable<E>, ef: (e: E) => Awaitable<F>, fg: (f: F) => Awaitable<G>, gh: (g: G) => Awaitable<H>, hi: (h: H) => Awaitable<I>, ij: (i: I) => Awaitable<J>, jk: (j: J) => Awaitable<K>): Promise<K>;
555
556
  };
556
557
  var _a: <A, B, C>(f: (a: A) => B, onError: (error: unknown, value: A) => C) => (a: A) => B | C;
557
558
  export { _a as try };
@@ -720,7 +721,7 @@ declare namespace tap {
720
721
  * );
721
722
  * ```
722
723
  */
723
- const async: <A>(fn: (a: A) => Promise<unknown>, options?: AsyncOptions) => (a: A) => A;
724
+ const async: <A>(fn: (a: A) => Thenable<unknown>, options?: AsyncOptions) => (a: A) => A;
724
725
  /**
725
726
  * Runs a function and measures its execution duration, returning the value unchanged.
726
727
  * Supports both synchronous and asynchronous functions. If the timed function returns