@nlozgachev/pipelined 0.44.0 → 0.45.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.
@@ -14,11 +14,14 @@ var Duration;
14
14
  Duration2.minutes = (m) => wrap(m * 60 * 1e3);
15
15
  Duration2.hours = (h) => wrap(h * 60 * 60 * 1e3);
16
16
  Duration2.days = (d) => wrap(d * 24 * 60 * 60 * 1e3);
17
- Duration2.toMilliseconds = (d) => Brand.unwrap(d);
18
- Duration2.toSeconds = (d) => Brand.unwrap(d) / 1e3;
19
- Duration2.toMinutes = (d) => Brand.unwrap(d) / (60 * 1e3);
20
- Duration2.toHours = (d) => Brand.unwrap(d) / (60 * 60 * 1e3);
21
- Duration2.toDays = (d) => Brand.unwrap(d) / (24 * 60 * 60 * 1e3);
17
+ let to;
18
+ ((to2) => {
19
+ to2.milliseconds = (d) => Brand.unwrap(d);
20
+ to2.seconds = (d) => Brand.unwrap(d) / 1e3;
21
+ to2.minutes = (d) => Brand.unwrap(d) / (60 * 1e3);
22
+ to2.hours = (d) => Brand.unwrap(d) / (60 * 60 * 1e3);
23
+ to2.days = (d) => Brand.unwrap(d) / (24 * 60 * 60 * 1e3);
24
+ })(to = Duration2.to || (Duration2.to = {}));
22
25
  Duration2.add = (other) => (self) => wrap(Brand.unwrap(self) + Brand.unwrap(other));
23
26
  Duration2.subtract = (other) => (self) => wrap(Brand.unwrap(self) - Brand.unwrap(other));
24
27
  })(Duration || (Duration = {}));
@@ -1,4 +1,4 @@
1
- import { A as Awaitable, T as Thenable } from './InternalTypes-BL23H8Qr.mjs';
1
+ import { A as Awaitable, T as Thenable } from './InternalTypes-CLE7qlOc.mjs';
2
2
  import { Duration } from './types.mjs';
3
3
 
4
4
  /**
@@ -110,13 +110,13 @@ declare const curry4: <A, B, C, D, E>(f: (a: A, b: B, c: C, d: D) => E) => (a: A
110
110
  * ```ts
111
111
  * // Original data-last (for pipe)
112
112
  * pipe(
113
- * Maybe.some(5),
113
+ * Maybe.make.some(5),
114
114
  * Maybe.map(n => n * 2)
115
115
  * ); // Some(10)
116
116
  *
117
117
  * // Flipped to data-first
118
118
  * const mapFirst = flip(Maybe.map);
119
- * mapFirst(Maybe.some(5))(n => n * 2); // Some(10)
119
+ * mapFirst(Maybe.make.some(5))(n => n * 2); // Some(10)
120
120
  * ```
121
121
  *
122
122
  * @see {@link uncurry} for converting curried functions to multi-argument functions
@@ -265,7 +265,7 @@ interface flow {
265
265
  * @example
266
266
  * ```ts
267
267
  * identity(42); // 42
268
- * pipe(Maybe.some(5), Maybe.fold(() => 0, identity)); // 5
268
+ * pipe(Maybe.make.some(5), Maybe.fold(() => 0, identity)); // 5
269
269
  * ```
270
270
  */
271
271
  declare const identity: <A>(a: A) => A;
@@ -496,7 +496,7 @@ declare function async<A, B, C, D, E, F, G, H, I, J, K>(a: Awaitable<A>, ab: (a:
496
496
  *
497
497
  * // With library functions
498
498
  * const greeting = pipe(
499
- * Maybe.some("Alice"),
499
+ * Maybe.make.some("Alice"),
500
500
  * Maybe.map(name => name.toUpperCase()),
501
501
  * Maybe.map(name => `Hello, ${name}!`),
502
502
  * Maybe.getOrElse(() => "Hello!")
@@ -599,7 +599,7 @@ interface pipe {
599
599
  * ```ts
600
600
  * // Debugging a pipeline
601
601
  * pipe(
602
- * Maybe.some(5),
602
+ * Maybe.make.some(5),
603
603
  * tap(x => console.log("Before map:", x)),
604
604
  * Maybe.map(n => n * 2),
605
605
  * tap(x => console.log("After map:", x)),
@@ -739,7 +739,7 @@ declare namespace tap {
739
739
  * pipe(
740
740
  * data,
741
741
  * tap.time(fetchData, {
742
- * onFinish: (dur) => metrics.histogram("api.time", Duration.toMilliseconds(dur))
742
+ * onFinish: (dur) => metrics.histogram("api.time", Duration.to.milliseconds(dur))
743
743
  * })
744
744
  * );
745
745
  * ```
@@ -760,15 +760,15 @@ declare namespace tap {
760
760
  * uncurry(nested)(); // 42
761
761
  *
762
762
  * // Original curried function
763
- * Maybe.map(n => n * 2)(Maybe.some(5)); // Some(10)
763
+ * Maybe.map(n => n * 2)(Maybe.make.some(5)); // Some(10)
764
764
  *
765
765
  * // Uncurried - all arguments at once
766
766
  * const mapUncurried = uncurry(Maybe.map);
767
- * mapUncurried(n => n * 2, Maybe.some(5)); // Some(10)
767
+ * mapUncurried(n => n * 2, Maybe.make.some(5)); // Some(10)
768
768
  *
769
769
  * // Combined with flip for data-first uncurried
770
770
  * const mapDataFirst = uncurry(flip(Maybe.map));
771
- * mapDataFirst(Maybe.some(5), n => n * 2); // Some(10)
771
+ * mapDataFirst(Maybe.make.some(5), n => n * 2); // Some(10)
772
772
  * ```
773
773
  *
774
774
  * @see {@link flip} for reversing curried argument order
@@ -1,4 +1,4 @@
1
- import { A as Awaitable, T as Thenable } from './InternalTypes-7o9-yrHq.js';
1
+ import { A as Awaitable, T as Thenable } from './InternalTypes-Mssktd7z.js';
2
2
  import { Duration } from './types.js';
3
3
 
4
4
  /**
@@ -110,13 +110,13 @@ declare const curry4: <A, B, C, D, E>(f: (a: A, b: B, c: C, d: D) => E) => (a: A
110
110
  * ```ts
111
111
  * // Original data-last (for pipe)
112
112
  * pipe(
113
- * Maybe.some(5),
113
+ * Maybe.make.some(5),
114
114
  * Maybe.map(n => n * 2)
115
115
  * ); // Some(10)
116
116
  *
117
117
  * // Flipped to data-first
118
118
  * const mapFirst = flip(Maybe.map);
119
- * mapFirst(Maybe.some(5))(n => n * 2); // Some(10)
119
+ * mapFirst(Maybe.make.some(5))(n => n * 2); // Some(10)
120
120
  * ```
121
121
  *
122
122
  * @see {@link uncurry} for converting curried functions to multi-argument functions
@@ -265,7 +265,7 @@ interface flow {
265
265
  * @example
266
266
  * ```ts
267
267
  * identity(42); // 42
268
- * pipe(Maybe.some(5), Maybe.fold(() => 0, identity)); // 5
268
+ * pipe(Maybe.make.some(5), Maybe.fold(() => 0, identity)); // 5
269
269
  * ```
270
270
  */
271
271
  declare const identity: <A>(a: A) => A;
@@ -496,7 +496,7 @@ declare function async<A, B, C, D, E, F, G, H, I, J, K>(a: Awaitable<A>, ab: (a:
496
496
  *
497
497
  * // With library functions
498
498
  * const greeting = pipe(
499
- * Maybe.some("Alice"),
499
+ * Maybe.make.some("Alice"),
500
500
  * Maybe.map(name => name.toUpperCase()),
501
501
  * Maybe.map(name => `Hello, ${name}!`),
502
502
  * Maybe.getOrElse(() => "Hello!")
@@ -599,7 +599,7 @@ interface pipe {
599
599
  * ```ts
600
600
  * // Debugging a pipeline
601
601
  * pipe(
602
- * Maybe.some(5),
602
+ * Maybe.make.some(5),
603
603
  * tap(x => console.log("Before map:", x)),
604
604
  * Maybe.map(n => n * 2),
605
605
  * tap(x => console.log("After map:", x)),
@@ -739,7 +739,7 @@ declare namespace tap {
739
739
  * pipe(
740
740
  * data,
741
741
  * tap.time(fetchData, {
742
- * onFinish: (dur) => metrics.histogram("api.time", Duration.toMilliseconds(dur))
742
+ * onFinish: (dur) => metrics.histogram("api.time", Duration.to.milliseconds(dur))
743
743
  * })
744
744
  * );
745
745
  * ```
@@ -760,15 +760,15 @@ declare namespace tap {
760
760
  * uncurry(nested)(); // 42
761
761
  *
762
762
  * // Original curried function
763
- * Maybe.map(n => n * 2)(Maybe.some(5)); // Some(10)
763
+ * Maybe.map(n => n * 2)(Maybe.make.some(5)); // Some(10)
764
764
  *
765
765
  * // Uncurried - all arguments at once
766
766
  * const mapUncurried = uncurry(Maybe.map);
767
- * mapUncurried(n => n * 2, Maybe.some(5)); // Some(10)
767
+ * mapUncurried(n => n * 2, Maybe.make.some(5)); // Some(10)
768
768
  *
769
769
  * // Combined with flip for data-first uncurried
770
770
  * const mapDataFirst = uncurry(flip(Maybe.map));
771
- * mapDataFirst(Maybe.some(5), n => n * 2); // Some(10)
771
+ * mapDataFirst(Maybe.make.some(5), n => n * 2); // Some(10)
772
772
  * ```
773
773
  *
774
774
  * @see {@link flip} for reversing curried argument order
@@ -387,11 +387,14 @@ var Duration;
387
387
  Duration2.minutes = (m) => wrap(m * 60 * 1e3);
388
388
  Duration2.hours = (h) => wrap(h * 60 * 60 * 1e3);
389
389
  Duration2.days = (d) => wrap(d * 24 * 60 * 60 * 1e3);
390
- Duration2.toMilliseconds = (d) => Brand.unwrap(d);
391
- Duration2.toSeconds = (d) => Brand.unwrap(d) / 1e3;
392
- Duration2.toMinutes = (d) => Brand.unwrap(d) / (60 * 1e3);
393
- Duration2.toHours = (d) => Brand.unwrap(d) / (60 * 60 * 1e3);
394
- Duration2.toDays = (d) => Brand.unwrap(d) / (24 * 60 * 60 * 1e3);
390
+ let to;
391
+ ((to2) => {
392
+ to2.milliseconds = (d) => Brand.unwrap(d);
393
+ to2.seconds = (d) => Brand.unwrap(d) / 1e3;
394
+ to2.minutes = (d) => Brand.unwrap(d) / (60 * 1e3);
395
+ to2.hours = (d) => Brand.unwrap(d) / (60 * 60 * 1e3);
396
+ to2.days = (d) => Brand.unwrap(d) / (24 * 60 * 60 * 1e3);
397
+ })(to = Duration2.to || (Duration2.to = {}));
395
398
  Duration2.add = (other) => (self) => wrap(Brand.unwrap(self) + Brand.unwrap(other));
396
399
  Duration2.subtract = (other) => (self) => wrap(Brand.unwrap(self) - Brand.unwrap(other));
397
400
  })(Duration || (Duration = {}));
@@ -453,7 +456,7 @@ function tap(f) {
453
456
  const start = performance.now();
454
457
  const triggerFinish = (duration) => {
455
458
  if (config.label !== void 0) {
456
- console.log(`[${config.label}]: ${Duration.toMilliseconds(duration)}ms`);
459
+ console.log(`[${config.label}]: ${Duration.to.milliseconds(duration)}ms`);
457
460
  } else {
458
461
  config.onFinish(duration);
459
462
  }
@@ -27,8 +27,8 @@ import {
27
27
  uncurry,
28
28
  uncurry3,
29
29
  uncurry4
30
- } from "./chunk-X6XQX3OZ.mjs";
31
- import "./chunk-74JKKJ4R.mjs";
30
+ } from "./chunk-KOYYDQH4.mjs";
31
+ import "./chunk-XTVF5R6R.mjs";
32
32
  export {
33
33
  and,
34
34
  compose,