@nlozgachev/pipelined 0.53.0 → 0.55.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/dist/types.cjs ADDED
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Types/index.ts
21
+ var Types_exports = {};
22
+ __export(Types_exports, {
23
+ Brand: () => Brand,
24
+ Duration: () => Duration,
25
+ RetryPolicy: () => RetryPolicy
26
+ });
27
+ module.exports = __toCommonJS(Types_exports);
28
+
29
+ // src/Types/Brand.ts
30
+ var Brand;
31
+ ((Brand2) => {
32
+ Brand2.wrap = () => (value) => value;
33
+ Brand2.unwrap = (branded) => branded;
34
+ })(Brand || (Brand = {}));
35
+
36
+ // src/Types/Duration.ts
37
+ var Duration;
38
+ ((Duration2) => {
39
+ const wrap = Brand.wrap();
40
+ Duration2.milliseconds = (ms) => wrap(ms);
41
+ Duration2.seconds = (s) => wrap(s * 1e3);
42
+ Duration2.minutes = (m) => wrap(m * 60 * 1e3);
43
+ Duration2.hours = (h) => wrap(h * 60 * 60 * 1e3);
44
+ Duration2.days = (d) => wrap(d * 24 * 60 * 60 * 1e3);
45
+ let to;
46
+ ((to2) => {
47
+ to2.milliseconds = (d) => Brand.unwrap(d);
48
+ to2.seconds = (d) => Brand.unwrap(d) / 1e3;
49
+ to2.minutes = (d) => Brand.unwrap(d) / (60 * 1e3);
50
+ to2.hours = (d) => Brand.unwrap(d) / (60 * 60 * 1e3);
51
+ to2.days = (d) => Brand.unwrap(d) / (24 * 60 * 60 * 1e3);
52
+ })(to = Duration2.to || (Duration2.to = {}));
53
+ Duration2.add = (other) => (self) => wrap(Brand.unwrap(self) + Brand.unwrap(other));
54
+ Duration2.subtract = (other) => (self) => wrap(Brand.unwrap(self) - Brand.unwrap(other));
55
+ })(Duration || (Duration = {}));
56
+
57
+ // src/Types/RetryPolicy.ts
58
+ var RetryPolicy;
59
+ ((RetryPolicy2) => {
60
+ RetryPolicy2.constant = (options) => ({
61
+ attempts: Math.max(1, options.attempts),
62
+ getDelay: () => options.delay
63
+ });
64
+ RetryPolicy2.exponential = (options) => {
65
+ const attempts = Math.max(1, options.attempts);
66
+ const initialMs = Duration.to.milliseconds(options.initial);
67
+ const factor = options.factor ?? 2;
68
+ const jitter = options.jitter ?? false;
69
+ return {
70
+ attempts,
71
+ getDelay: (attempt) => {
72
+ const rawMs = initialMs * factor ** Math.max(0, attempt - 1);
73
+ const finalMs = jitter ? Math.random() * rawMs : rawMs;
74
+ return Duration.milliseconds(finalMs);
75
+ }
76
+ };
77
+ };
78
+ })(RetryPolicy || (RetryPolicy = {}));
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ Brand,
82
+ Duration,
83
+ RetryPolicy
84
+ });
@@ -1,5 +1,5 @@
1
- import { D as Duration } from './Duration-B8joKzro.mjs';
2
- export { B as Brand } from './Duration-B8joKzro.mjs';
1
+ import { D as Duration } from './Duration-B8joKzro.cjs';
2
+ export { B as Brand } from './Duration-B8joKzro.cjs';
3
3
 
4
4
  /**
5
5
  * An immutable policy describing retry limits and backoff delay strategies.
package/dist/types.js CHANGED
@@ -1,84 +1,10 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/Types/index.ts
21
- var Types_exports = {};
22
- __export(Types_exports, {
23
- Brand: () => Brand,
24
- Duration: () => Duration,
25
- RetryPolicy: () => RetryPolicy
26
- });
27
- module.exports = __toCommonJS(Types_exports);
28
-
29
- // src/Types/Brand.ts
30
- var Brand;
31
- ((Brand2) => {
32
- Brand2.wrap = () => (value) => value;
33
- Brand2.unwrap = (branded) => branded;
34
- })(Brand || (Brand = {}));
35
-
36
- // src/Types/Duration.ts
37
- var Duration;
38
- ((Duration2) => {
39
- const wrap = Brand.wrap();
40
- Duration2.milliseconds = (ms) => wrap(ms);
41
- Duration2.seconds = (s) => wrap(s * 1e3);
42
- Duration2.minutes = (m) => wrap(m * 60 * 1e3);
43
- Duration2.hours = (h) => wrap(h * 60 * 60 * 1e3);
44
- Duration2.days = (d) => wrap(d * 24 * 60 * 60 * 1e3);
45
- let to;
46
- ((to2) => {
47
- to2.milliseconds = (d) => Brand.unwrap(d);
48
- to2.seconds = (d) => Brand.unwrap(d) / 1e3;
49
- to2.minutes = (d) => Brand.unwrap(d) / (60 * 1e3);
50
- to2.hours = (d) => Brand.unwrap(d) / (60 * 60 * 1e3);
51
- to2.days = (d) => Brand.unwrap(d) / (24 * 60 * 60 * 1e3);
52
- })(to = Duration2.to || (Duration2.to = {}));
53
- Duration2.add = (other) => (self) => wrap(Brand.unwrap(self) + Brand.unwrap(other));
54
- Duration2.subtract = (other) => (self) => wrap(Brand.unwrap(self) - Brand.unwrap(other));
55
- })(Duration || (Duration = {}));
56
-
57
- // src/Types/RetryPolicy.ts
58
- var RetryPolicy;
59
- ((RetryPolicy2) => {
60
- RetryPolicy2.constant = (options) => ({
61
- attempts: Math.max(1, options.attempts),
62
- getDelay: () => options.delay
63
- });
64
- RetryPolicy2.exponential = (options) => {
65
- const attempts = Math.max(1, options.attempts);
66
- const initialMs = Duration.to.milliseconds(options.initial);
67
- const factor = options.factor ?? 2;
68
- const jitter = options.jitter ?? false;
69
- return {
70
- attempts,
71
- getDelay: (attempt) => {
72
- const rawMs = initialMs * factor ** Math.max(0, attempt - 1);
73
- const finalMs = jitter ? Math.random() * rawMs : rawMs;
74
- return Duration.milliseconds(finalMs);
75
- }
76
- };
77
- };
78
- })(RetryPolicy || (RetryPolicy = {}));
79
- // Annotate the CommonJS export names for ESM import in node:
80
- 0 && (module.exports = {
1
+ import {
2
+ Brand,
3
+ Duration,
4
+ RetryPolicy
5
+ } from "./chunk-OIIOGDHK.js";
6
+ export {
81
7
  Brand,
82
8
  Duration,
83
9
  RetryPolicy
84
- });
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nlozgachev/pipelined",
3
- "version": "0.53.0",
3
+ "version": "0.55.0",
4
4
  "description": "Opinionated functional abstractions for TypeScript",
5
5
  "license": "BSD-3-Clause",
6
6
  "homepage": "https://pipelined.lozgachev.dev",
@@ -16,6 +16,7 @@
16
16
  "pipe"
17
17
  ],
18
18
  "types": "./dist/index.d.ts",
19
+ "type": "module",
19
20
  "sideEffects": false,
20
21
  "engines": {
21
22
  "node": ">=24.19.0"
@@ -1,65 +0,0 @@
1
- import {
2
- and,
3
- compose,
4
- constFalse,
5
- constNull,
6
- constTrue,
7
- constUndefined,
8
- constVoid,
9
- constant,
10
- converge,
11
- curry,
12
- curry3,
13
- curry4,
14
- defaultTo,
15
- flip,
16
- flow,
17
- identity,
18
- juxt,
19
- memoize,
20
- memoizeWeak,
21
- not,
22
- on,
23
- once,
24
- or,
25
- pipe,
26
- tap,
27
- tuple,
28
- uncurry,
29
- uncurry3,
30
- uncurry4,
31
- untuple
32
- } from "./chunk-5OFVS5UZ.mjs";
33
- import "./chunk-DENXUTKL.mjs";
34
- export {
35
- and,
36
- compose,
37
- constFalse,
38
- constNull,
39
- constTrue,
40
- constUndefined,
41
- constVoid,
42
- constant,
43
- converge,
44
- curry,
45
- curry3,
46
- curry4,
47
- defaultTo,
48
- flip,
49
- flow,
50
- identity,
51
- juxt,
52
- memoize,
53
- memoizeWeak,
54
- not,
55
- on,
56
- once,
57
- or,
58
- pipe,
59
- tap,
60
- tuple,
61
- uncurry,
62
- uncurry3,
63
- uncurry4,
64
- untuple
65
- };
package/dist/core.mjs DELETED
@@ -1,49 +0,0 @@
1
- import {
2
- Combinable,
3
- Deferred,
4
- Equality,
5
- Lazy,
6
- Lens,
7
- Logged,
8
- Maybe,
9
- Op,
10
- Optional,
11
- Ordering,
12
- Predicate,
13
- Reader,
14
- Refinement,
15
- RemoteData,
16
- Resource,
17
- Result,
18
- State,
19
- Stream,
20
- Task,
21
- These,
22
- Tuple,
23
- Validation
24
- } from "./chunk-XFE3SQEE.mjs";
25
- import "./chunk-DENXUTKL.mjs";
26
- export {
27
- Combinable,
28
- Deferred,
29
- Equality,
30
- Lazy,
31
- Lens,
32
- Logged,
33
- Maybe,
34
- Op,
35
- Optional,
36
- Ordering,
37
- Predicate,
38
- Reader,
39
- Refinement,
40
- RemoteData,
41
- Resource,
42
- Result,
43
- State,
44
- Stream,
45
- Task,
46
- These,
47
- Tuple,
48
- Validation
49
- };
package/dist/data.mjs DELETED
@@ -1,22 +0,0 @@
1
- import {
2
- Arr,
3
- BigNum,
4
- Dict,
5
- Json,
6
- Num,
7
- Rec,
8
- Str,
9
- Uniq
10
- } from "./chunk-L6GLADRU.mjs";
11
- import "./chunk-XFE3SQEE.mjs";
12
- import "./chunk-DENXUTKL.mjs";
13
- export {
14
- Arr,
15
- BigNum,
16
- Dict,
17
- Json,
18
- Num,
19
- Rec,
20
- Str,
21
- Uniq
22
- };
package/dist/index.mjs DELETED
@@ -1,136 +0,0 @@
1
- import {
2
- and,
3
- compose,
4
- constFalse,
5
- constNull,
6
- constTrue,
7
- constUndefined,
8
- constVoid,
9
- constant,
10
- converge,
11
- curry,
12
- curry3,
13
- curry4,
14
- defaultTo,
15
- flip,
16
- flow,
17
- identity,
18
- juxt,
19
- memoize,
20
- memoizeWeak,
21
- not,
22
- on,
23
- once,
24
- or,
25
- pipe,
26
- tap,
27
- tuple,
28
- uncurry,
29
- uncurry3,
30
- uncurry4,
31
- untuple
32
- } from "./chunk-5OFVS5UZ.mjs";
33
- import {
34
- Arr,
35
- BigNum,
36
- Dict,
37
- Json,
38
- Num,
39
- Rec,
40
- Str,
41
- Uniq
42
- } from "./chunk-L6GLADRU.mjs";
43
- import {
44
- Combinable,
45
- Deferred,
46
- Equality,
47
- Lazy,
48
- Lens,
49
- Logged,
50
- Maybe,
51
- Op,
52
- Optional,
53
- Ordering,
54
- Predicate,
55
- Reader,
56
- Refinement,
57
- RemoteData,
58
- Resource,
59
- Result,
60
- State,
61
- Stream,
62
- Task,
63
- These,
64
- Tuple,
65
- Validation
66
- } from "./chunk-XFE3SQEE.mjs";
67
- import {
68
- Brand,
69
- Duration,
70
- RetryPolicy
71
- } from "./chunk-DENXUTKL.mjs";
72
- export {
73
- Arr,
74
- BigNum,
75
- Brand,
76
- Combinable,
77
- Deferred,
78
- Dict,
79
- Duration,
80
- Equality,
81
- Json,
82
- Lazy,
83
- Lens,
84
- Logged,
85
- Maybe,
86
- Num,
87
- Op,
88
- Optional,
89
- Ordering,
90
- Predicate,
91
- Reader,
92
- Rec,
93
- Refinement,
94
- RemoteData,
95
- Resource,
96
- Result,
97
- RetryPolicy,
98
- State,
99
- Str,
100
- Stream,
101
- Task,
102
- These,
103
- Tuple,
104
- Uniq,
105
- Validation,
106
- and,
107
- compose,
108
- constFalse,
109
- constNull,
110
- constTrue,
111
- constUndefined,
112
- constVoid,
113
- constant,
114
- converge,
115
- curry,
116
- curry3,
117
- curry4,
118
- defaultTo,
119
- flip,
120
- flow,
121
- identity,
122
- juxt,
123
- memoize,
124
- memoizeWeak,
125
- not,
126
- on,
127
- once,
128
- or,
129
- pipe,
130
- tap,
131
- tuple,
132
- uncurry,
133
- uncurry3,
134
- uncurry4,
135
- untuple
136
- };
package/dist/types.mjs DELETED
@@ -1,10 +0,0 @@
1
- import {
2
- Brand,
3
- Duration,
4
- RetryPolicy
5
- } from "./chunk-DENXUTKL.mjs";
6
- export {
7
- Brand,
8
- Duration,
9
- RetryPolicy
10
- };
File without changes