@nlozgachev/pipelined 0.66.0 → 0.67.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/README.md +18 -5
- package/dist/{Core-D7_9dZpV.mjs → Core-BCN6WRzp.mjs} +761 -419
- package/dist/{Core-6SkC-fh5.cjs → Core-CfAL_21H.cjs} +761 -419
- package/dist/{InternalTypes-DzDey5Do.d.ts → InternalTypes-C0F5jyVQ.d.ts} +1 -1
- package/dist/{InternalTypes-B1Lh9uw_.d.cts → InternalTypes-DxSlzrpu.d.cts} +1 -1
- package/dist/composition.d.cts +2 -2
- package/dist/composition.d.ts +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.mjs +1 -1
- package/dist/data.cjs +991 -527
- package/dist/data.d.cts +479 -308
- package/dist/data.d.ts +479 -308
- package/dist/data.mjs +991 -527
- package/dist/{index-Bs8En5LJ.d.cts → index-CTe9CCHY.d.cts} +3 -0
- package/dist/{index-Bs8En5LJ.d.ts → index-CTe9CCHY.d.ts} +3 -0
- package/dist/{index-8A9NqJTq.d.cts → index-CdzHrj62.d.ts} +609 -298
- package/dist/{index-CY4ZLbjM.d.ts → index-NYjtX7XS.d.cts} +609 -298
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/types.cjs +5 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.mjs +5 -1
- package/package.json +20 -19
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_types = require("./types.cjs");
|
|
3
3
|
const require_composition = require("./composition.cjs");
|
|
4
|
-
const require_Core = require("./Core-
|
|
4
|
+
const require_Core = require("./Core-CfAL_21H.cjs");
|
|
5
5
|
const require_data = require("./data.cjs");
|
|
6
6
|
exports.Arr = require_data.Arr;
|
|
7
7
|
exports.BigNum = require_data.BigNum;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-
|
|
2
|
-
import { x as Deferred } from "./InternalTypes-
|
|
3
|
-
import { A as Lens, C as Ordering, D as None, E as Maybe, M as EventBus, N as Equality, O as Some, P as Combinable, S as Pair, T as Op, _ as RemoteData, a as Task, b as Reader, c as Validation, d as Ok, f as Result, g as NotAsked, h as Loading, i as TheseSecond, j as Lazy, k as Logged, l as State, m as Failure, n as TheseBoth, o as Failed, p as Resource, r as TheseFirst, s as Passed, t as These, u as Err, v as Success, w as Optional, x as Predicate, y as Refinement } from "./index-
|
|
1
|
+
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-CTe9CCHY.cjs";
|
|
2
|
+
import { x as Deferred } from "./InternalTypes-DxSlzrpu.cjs";
|
|
3
|
+
import { A as Lens, C as Ordering, D as None, E as Maybe, M as EventBus, N as Equality, O as Some, P as Combinable, S as Pair, T as Op, _ as RemoteData, a as Task, b as Reader, c as Validation, d as Ok, f as Result, g as NotAsked, h as Loading, i as TheseSecond, j as Lazy, k as Logged, l as State, m as Failure, n as TheseBoth, o as Failed, p as Resource, r as TheseFirst, s as Passed, t as These, u as Err, v as Success, w as Optional, x as Predicate, y as Refinement } from "./index-NYjtX7XS.cjs";
|
|
4
4
|
import { and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, tuple, uncurry, uncurry3, uncurry4, untuple } from "./composition.cjs";
|
|
5
5
|
import { Arr, BigNum, Bool, BoolMatchCases, Dict, Json, NonEmptyMap, NonEmptyRecord, NonEmptySet, NonEmptyString, Num, Rec, Str, Uniq } from "./data.cjs";
|
|
6
6
|
export { Arr, BigNum, Bool, BoolMatchCases, Brand, Combinable, Deferred, Dict, Duration, Equality, Err, EventBus, Failed, Failure, Json, Lazy, Lens, Loading, Logged, Maybe, NonEmptyMap, NonEmptyRecord, NonEmptySet, NonEmptyString, None, NotAsked, Num, Ok, Op, Optional, Ordering, Pair, Passed, Predicate, Reader, Rec, Refinement, RemoteData, Resource, Result, RetryPolicy, Some, State, Str, Success, Task, These, TheseBoth, TheseFirst, TheseSecond, Uniq, Validation, and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, tuple, uncurry, uncurry3, uncurry4, untuple };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-
|
|
2
|
-
import { x as Deferred } from "./InternalTypes-
|
|
3
|
-
import { A as Lens, C as Ordering, D as None, E as Maybe, M as EventBus, N as Equality, O as Some, P as Combinable, S as Pair, T as Op, _ as RemoteData, a as Task, b as Reader, c as Validation, d as Ok, f as Result, g as NotAsked, h as Loading, i as TheseSecond, j as Lazy, k as Logged, l as State, m as Failure, n as TheseBoth, o as Failed, p as Resource, r as TheseFirst, s as Passed, t as These, u as Err, v as Success, w as Optional, x as Predicate, y as Refinement } from "./index-
|
|
1
|
+
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-CTe9CCHY.js";
|
|
2
|
+
import { x as Deferred } from "./InternalTypes-C0F5jyVQ.js";
|
|
3
|
+
import { A as Lens, C as Ordering, D as None, E as Maybe, M as EventBus, N as Equality, O as Some, P as Combinable, S as Pair, T as Op, _ as RemoteData, a as Task, b as Reader, c as Validation, d as Ok, f as Result, g as NotAsked, h as Loading, i as TheseSecond, j as Lazy, k as Logged, l as State, m as Failure, n as TheseBoth, o as Failed, p as Resource, r as TheseFirst, s as Passed, t as These, u as Err, v as Success, w as Optional, x as Predicate, y as Refinement } from "./index-CdzHrj62.js";
|
|
4
4
|
import { and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, tuple, uncurry, uncurry3, uncurry4, untuple } from "./composition.js";
|
|
5
5
|
import { Arr, BigNum, Bool, BoolMatchCases, Dict, Json, NonEmptyMap, NonEmptyRecord, NonEmptySet, NonEmptyString, Num, Rec, Str, Uniq } from "./data.js";
|
|
6
6
|
export { Arr, BigNum, Bool, BoolMatchCases, Brand, Combinable, Deferred, Dict, Duration, Equality, Err, EventBus, Failed, Failure, Json, Lazy, Lens, Loading, Logged, Maybe, NonEmptyMap, NonEmptyRecord, NonEmptySet, NonEmptyString, None, NotAsked, Num, Ok, Op, Optional, Ordering, Pair, Passed, Predicate, Reader, Rec, Refinement, RemoteData, Resource, Result, RetryPolicy, Some, State, Str, Success, Task, These, TheseBoth, TheseFirst, TheseSecond, Uniq, Validation, and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, tuple, uncurry, uncurry3, uncurry4, untuple };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Brand, Duration, RetryPolicy } from "./types.mjs";
|
|
2
2
|
import { and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, tuple, uncurry, uncurry3, uncurry4, untuple } from "./composition.mjs";
|
|
3
|
-
import { C as Combinable, S as Deferred, _ as Logged, a as State, b as EventBus, c as RemoteData, d as Predicate, f as Pair, g as Maybe, h as Op, l as Refinement, m as Optional, n as Task, o as Result, p as Ordering, r as Validation, s as Resource, t as These, u as Reader, v as Lens, x as Equality, y as Lazy } from "./Core-
|
|
3
|
+
import { C as Combinable, S as Deferred, _ as Logged, a as State, b as EventBus, c as RemoteData, d as Predicate, f as Pair, g as Maybe, h as Op, l as Refinement, m as Optional, n as Task, o as Result, p as Ordering, r as Validation, s as Resource, t as These, u as Reader, v as Lens, x as Equality, y as Lazy } from "./Core-BCN6WRzp.mjs";
|
|
4
4
|
import { Arr, BigNum, Bool, Dict, Json, Num, Rec, Str, Uniq } from "./data.mjs";
|
|
5
5
|
export { Arr, BigNum, Bool, Brand, Combinable, Deferred, Dict, Duration, Equality, EventBus, Json, Lazy, Lens, Logged, Maybe, Num, Op, Optional, Ordering, Pair, Predicate, Reader, Rec, Refinement, RemoteData, Resource, Result, RetryPolicy, State, Str, Task, These, Uniq, Validation, and, compose, constFalse, constNull, constTrue, constUndefined, constVoid, constant, converge, curry, curry3, curry4, defaultTo, flip, flow, identity, juxt, memoize, memoizeWeak, not, on, once, or, pipe, tap, tuple, uncurry, uncurry3, uncurry4, untuple };
|
package/dist/types.cjs
CHANGED
|
@@ -51,6 +51,7 @@ const RetryPolicy = {
|
|
|
51
51
|
* Creates a RetryPolicy with exponential backoff delays between attempts.
|
|
52
52
|
* An optional `factor` (default 2) controls the growth rate.
|
|
53
53
|
* An optional `jitter` (default false) adds randomized variance to prevent thundering herd problems.
|
|
54
|
+
* An optional `maxDelay` caps the maximum duration between retry attempts.
|
|
54
55
|
*
|
|
55
56
|
* @example
|
|
56
57
|
* ```ts
|
|
@@ -59,6 +60,7 @@ const RetryPolicy = {
|
|
|
59
60
|
* initial: Duration.milliseconds(100),
|
|
60
61
|
* factor: 2,
|
|
61
62
|
* jitter: true,
|
|
63
|
+
* maxDelay: Duration.seconds(5),
|
|
62
64
|
* });
|
|
63
65
|
* ```
|
|
64
66
|
*/
|
|
@@ -67,11 +69,13 @@ const RetryPolicy = {
|
|
|
67
69
|
const initialMs = Duration.to.milliseconds(options.initial);
|
|
68
70
|
const factor = options.factor ?? 2;
|
|
69
71
|
const jitter = options.jitter ?? false;
|
|
72
|
+
const maxMs = options.maxDelay ? Duration.to.milliseconds(options.maxDelay) : void 0;
|
|
70
73
|
return {
|
|
71
74
|
attempts,
|
|
72
75
|
getDelay: (attempt) => {
|
|
73
76
|
const rawMs = initialMs * factor ** Math.max(0, attempt - 1);
|
|
74
|
-
const
|
|
77
|
+
const cappedMs = maxMs !== void 0 ? Math.min(rawMs, maxMs) : rawMs;
|
|
78
|
+
const finalMs = jitter ? Math.random() * cappedMs : cappedMs;
|
|
75
79
|
return Duration.milliseconds(finalMs);
|
|
76
80
|
}
|
|
77
81
|
};
|
package/dist/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-
|
|
1
|
+
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-CTe9CCHY.cjs";
|
|
2
2
|
export { Brand, Duration, RetryPolicy };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-
|
|
1
|
+
import { n as Duration, r as Brand, t as RetryPolicy } from "./index-CTe9CCHY.js";
|
|
2
2
|
export { Brand, Duration, RetryPolicy };
|
package/dist/types.mjs
CHANGED
|
@@ -50,6 +50,7 @@ const RetryPolicy = {
|
|
|
50
50
|
* Creates a RetryPolicy with exponential backoff delays between attempts.
|
|
51
51
|
* An optional `factor` (default 2) controls the growth rate.
|
|
52
52
|
* An optional `jitter` (default false) adds randomized variance to prevent thundering herd problems.
|
|
53
|
+
* An optional `maxDelay` caps the maximum duration between retry attempts.
|
|
53
54
|
*
|
|
54
55
|
* @example
|
|
55
56
|
* ```ts
|
|
@@ -58,6 +59,7 @@ const RetryPolicy = {
|
|
|
58
59
|
* initial: Duration.milliseconds(100),
|
|
59
60
|
* factor: 2,
|
|
60
61
|
* jitter: true,
|
|
62
|
+
* maxDelay: Duration.seconds(5),
|
|
61
63
|
* });
|
|
62
64
|
* ```
|
|
63
65
|
*/
|
|
@@ -66,11 +68,13 @@ const RetryPolicy = {
|
|
|
66
68
|
const initialMs = Duration.to.milliseconds(options.initial);
|
|
67
69
|
const factor = options.factor ?? 2;
|
|
68
70
|
const jitter = options.jitter ?? false;
|
|
71
|
+
const maxMs = options.maxDelay ? Duration.to.milliseconds(options.maxDelay) : void 0;
|
|
69
72
|
return {
|
|
70
73
|
attempts,
|
|
71
74
|
getDelay: (attempt) => {
|
|
72
75
|
const rawMs = initialMs * factor ** Math.max(0, attempt - 1);
|
|
73
|
-
const
|
|
76
|
+
const cappedMs = maxMs !== void 0 ? Math.min(rawMs, maxMs) : rawMs;
|
|
77
|
+
const finalMs = jitter ? Math.random() * cappedMs : cappedMs;
|
|
74
78
|
return Duration.milliseconds(finalMs);
|
|
75
79
|
}
|
|
76
80
|
};
|
package/package.json
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nlozgachev/pipelined",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"description": "Opinionated functional abstractions for TypeScript",
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"composition",
|
|
7
|
+
"fp",
|
|
8
|
+
"functional",
|
|
9
|
+
"pipe",
|
|
10
|
+
"typescript"
|
|
11
|
+
],
|
|
6
12
|
"homepage": "https://pipelined.lozgachev.dev",
|
|
13
|
+
"license": "BSD-3-Clause",
|
|
7
14
|
"repository": {
|
|
8
15
|
"type": "git",
|
|
9
16
|
"url": "git+https://github.com/nlozgachev/pipelined.git"
|
|
10
17
|
},
|
|
11
|
-
"keywords": [
|
|
12
|
-
"functional",
|
|
13
|
-
"fp",
|
|
14
|
-
"typescript",
|
|
15
|
-
"composition",
|
|
16
|
-
"pipe"
|
|
17
|
-
],
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
19
|
-
"type": "module",
|
|
20
|
-
"sideEffects": false,
|
|
21
|
-
"engines": {
|
|
22
|
-
"node": ">=18.0.0"
|
|
23
|
-
},
|
|
24
18
|
"files": [
|
|
25
19
|
"dist"
|
|
26
20
|
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
27
24
|
"imports": {
|
|
28
25
|
"#core": "./src/Core/index.ts",
|
|
29
26
|
"#data": "./src/Data/index.ts",
|
|
@@ -80,6 +77,8 @@
|
|
|
80
77
|
"bench": "vitest bench",
|
|
81
78
|
"size": "size-limit",
|
|
82
79
|
"typecheck": "tsc --noEmit",
|
|
80
|
+
"typecheck:dev": "tsc --noEmit --watch",
|
|
81
|
+
"typecheck:min": "pnpm dlx --package typescript@5.5 tsc --noEmit --skipLibCheck",
|
|
83
82
|
"publish:npm": "pnpm build && npm publish --access public",
|
|
84
83
|
"lint": "oxlint src/",
|
|
85
84
|
"format": "dprint fmt && dprint fmt --config dprint.md.json \"docs/**/*.md\" \"docs/**/*.mdx\" \"README.md\"",
|
|
@@ -98,7 +97,7 @@
|
|
|
98
97
|
"esbuild": "0.28.2",
|
|
99
98
|
"fast-check": "4.10.2",
|
|
100
99
|
"oxlint": "1.87.0",
|
|
101
|
-
"publint": "0.3.
|
|
100
|
+
"publint": "0.3.25",
|
|
102
101
|
"size-limit": "14.1.0",
|
|
103
102
|
"tsdown": "0.23.0",
|
|
104
103
|
"typescript": "6.0.3",
|
|
@@ -127,7 +126,7 @@
|
|
|
127
126
|
"name": "Data (import * as Data)",
|
|
128
127
|
"import": "*",
|
|
129
128
|
"path": "dist/data.mjs",
|
|
130
|
-
"limit": "
|
|
129
|
+
"limit": "10 KB",
|
|
131
130
|
"gzip": true
|
|
132
131
|
},
|
|
133
132
|
{
|
|
@@ -145,9 +144,11 @@
|
|
|
145
144
|
"name": "Types (import * as Types)",
|
|
146
145
|
"import": "*",
|
|
147
146
|
"path": "dist/types.mjs",
|
|
148
|
-
"limit": "
|
|
147
|
+
"limit": "450 B",
|
|
149
148
|
"gzip": true
|
|
150
149
|
}
|
|
151
150
|
],
|
|
152
|
-
"
|
|
151
|
+
"engines": {
|
|
152
|
+
"node": ">=18.0.0"
|
|
153
|
+
}
|
|
153
154
|
}
|