@oscarpalmer/atoms 0.184.2 → 0.185.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/array/index.d.mts +2 -2
- package/dist/array/index.mjs +2 -2
- package/dist/array/{position.d.mts → match.d.mts} +9 -6
- package/dist/array/{position.mjs → match.mjs} +16 -16
- package/dist/array/move.mjs +1 -1
- package/dist/array/sort.d.mts +9 -4
- package/dist/array/sort.mjs +1 -1
- package/dist/array/swap.mjs +1 -1
- package/dist/beacon.d.mts +12 -0
- package/dist/beacon.mjs +9 -0
- package/dist/color/instance.d.mts +8 -0
- package/dist/color/instance.mjs +3 -0
- package/dist/color/models.d.mts +30 -0
- package/dist/function/assert.d.mts +29 -8
- package/dist/function/assert.mjs +29 -8
- package/dist/function/memoize.d.mts +3 -0
- package/dist/function/memoize.mjs +3 -0
- package/dist/function/retry.d.mts +3 -0
- package/dist/function/retry.mjs +3 -0
- package/dist/function/work.mjs +1 -1
- package/dist/index.d.mts +271 -158
- package/dist/index.mjs +230 -163
- package/dist/internal/value/compare.d.mts +2 -1
- package/dist/internal/value/equal.d.mts +5 -0
- package/dist/internal/value/get.d.mts +2 -2
- package/dist/internal/value/has.d.mts +3 -3
- package/dist/internal/value/has.mjs +1 -1
- package/dist/internal/value/misc.d.mts +2 -2
- package/dist/internal/value/misc.mjs +10 -4
- package/dist/logger.d.mts +11 -0
- package/dist/logger.mjs +11 -0
- package/dist/promise/helpers.mjs +1 -1
- package/dist/promise/index.d.mts +0 -6
- package/dist/promise/models.d.mts +36 -0
- package/dist/promise/models.mjs +6 -0
- package/dist/queue.d.mts +13 -1
- package/dist/queue.mjs +9 -0
- package/dist/result/index.d.mts +0 -8
- package/dist/result/index.mjs +0 -8
- package/dist/result/match.d.mts +4 -4
- package/dist/result/work/flow.d.mts +12 -36
- package/dist/result/work/pipe.d.mts +11 -33
- package/dist/sized/set.d.mts +3 -2
- package/dist/sized/set.mjs +3 -2
- package/dist/value/handle.mjs +1 -1
- package/dist/value/shake.d.mts +3 -0
- package/dist/value/smush.d.mts +3 -0
- package/dist/value/transform.d.mts +9 -0
- package/dist/value/unsmush.d.mts +3 -0
- package/package.json +2 -2
- package/src/array/difference.ts +4 -0
- package/src/array/from.ts +4 -0
- package/src/array/index.ts +1 -1
- package/src/array/intersection.ts +4 -0
- package/src/array/{position.ts → match.ts} +28 -25
- package/src/array/move.ts +5 -1
- package/src/array/reverse.ts +4 -0
- package/src/array/select.ts +2 -0
- package/src/array/sort.ts +9 -4
- package/src/array/swap.ts +5 -1
- package/src/array/toggle.ts +4 -0
- package/src/array/union.ts +4 -0
- package/src/beacon.ts +12 -0
- package/src/color/index.ts +0 -3
- package/src/color/instance.ts +9 -1
- package/src/color/models.ts +30 -0
- package/src/function/assert.ts +66 -7
- package/src/function/memoize.ts +3 -0
- package/src/function/once.ts +5 -1
- package/src/function/retry.ts +3 -0
- package/src/internal/value/compare.ts +2 -1
- package/src/internal/value/equal.ts +5 -0
- package/src/internal/value/get.ts +2 -2
- package/src/internal/value/has.ts +6 -6
- package/src/internal/value/misc.ts +24 -13
- package/src/logger.ts +11 -0
- package/src/promise/index.ts +0 -6
- package/src/promise/models.ts +36 -0
- package/src/queue.ts +13 -1
- package/src/result/index.ts +0 -8
- package/src/result/match.ts +4 -4
- package/src/result/work/flow.ts +12 -36
- package/src/result/work/pipe.ts +11 -33
- package/src/sized/set.ts +4 -3
- package/src/value/shake.ts +3 -0
- package/src/value/smush.ts +3 -0
- package/src/value/transform.ts +9 -0
- package/src/value/unsmush.ts +3 -0
package/src/result/work/flow.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type AttemptFlowPromise<Callback extends GenericCallback, Value> = (
|
|
|
29
29
|
/**
|
|
30
30
|
* Create an asynchronous Flow, a function that attempts to pipe a value through a series of functions
|
|
31
31
|
*
|
|
32
|
-
* Available as `attemptAsyncFlow` and `
|
|
32
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
33
33
|
* @returns Flow function
|
|
34
34
|
*/
|
|
35
35
|
export function attemptAsyncFlow<Fn extends GenericCallback>(
|
|
@@ -39,7 +39,7 @@ export function attemptAsyncFlow<Fn extends GenericCallback>(
|
|
|
39
39
|
/**
|
|
40
40
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
41
41
|
*
|
|
42
|
-
* Available as `attemptAsyncFlow` and `
|
|
42
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
43
43
|
* @returns Flow function
|
|
44
44
|
*/
|
|
45
45
|
export function attemptAsyncFlow<First extends GenericCallback, Second>(
|
|
@@ -50,7 +50,7 @@ export function attemptAsyncFlow<First extends GenericCallback, Second>(
|
|
|
50
50
|
/**
|
|
51
51
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
52
52
|
*
|
|
53
|
-
* Available as `attemptAsyncFlow` and `
|
|
53
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
54
54
|
* @returns Flow function
|
|
55
55
|
*/
|
|
56
56
|
export function attemptAsyncFlow<First extends GenericCallback, Second, Third>(
|
|
@@ -62,7 +62,7 @@ export function attemptAsyncFlow<First extends GenericCallback, Second, Third>(
|
|
|
62
62
|
/**
|
|
63
63
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
64
64
|
*
|
|
65
|
-
* Available as `attemptAsyncFlow` and `
|
|
65
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
66
66
|
* @returns Flow function
|
|
67
67
|
*/
|
|
68
68
|
export function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth>(
|
|
@@ -75,7 +75,7 @@ export function attemptAsyncFlow<First extends GenericCallback, Second, Third, F
|
|
|
75
75
|
/**
|
|
76
76
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
77
77
|
*
|
|
78
|
-
* Available as `attemptAsyncFlow` and `
|
|
78
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
79
79
|
* @returns Flow function
|
|
80
80
|
*/
|
|
81
81
|
export function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(
|
|
@@ -89,7 +89,7 @@ export function attemptAsyncFlow<First extends GenericCallback, Second, Third, F
|
|
|
89
89
|
/**
|
|
90
90
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
91
91
|
*
|
|
92
|
-
* Available as `attemptAsyncFlow` and `
|
|
92
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
93
93
|
* @returns Flow function
|
|
94
94
|
*/
|
|
95
95
|
export function attemptAsyncFlow<
|
|
@@ -111,7 +111,7 @@ export function attemptAsyncFlow<
|
|
|
111
111
|
/**
|
|
112
112
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
113
113
|
*
|
|
114
|
-
* Available as `attemptAsyncFlow` and `
|
|
114
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
115
115
|
* @returns Flow function
|
|
116
116
|
*/
|
|
117
117
|
export function attemptAsyncFlow<
|
|
@@ -135,7 +135,7 @@ export function attemptAsyncFlow<
|
|
|
135
135
|
/**
|
|
136
136
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
137
137
|
*
|
|
138
|
-
* Available as `attemptAsyncFlow` and `
|
|
138
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
139
139
|
* @returns Flow function
|
|
140
140
|
*/
|
|
141
141
|
export function attemptAsyncFlow<
|
|
@@ -161,7 +161,7 @@ export function attemptAsyncFlow<
|
|
|
161
161
|
/**
|
|
162
162
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
163
163
|
*
|
|
164
|
-
* Available as `attemptAsyncFlow` and `
|
|
164
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
165
165
|
* @returns Flow function
|
|
166
166
|
*/
|
|
167
167
|
export function attemptAsyncFlow<
|
|
@@ -189,7 +189,7 @@ export function attemptAsyncFlow<
|
|
|
189
189
|
/**
|
|
190
190
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
191
191
|
*
|
|
192
|
-
* Available as `attemptAsyncFlow` and `
|
|
192
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
193
193
|
* @returns Flow function
|
|
194
194
|
*/
|
|
195
195
|
export function attemptAsyncFlow<
|
|
@@ -219,7 +219,7 @@ export function attemptAsyncFlow<
|
|
|
219
219
|
/**
|
|
220
220
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
221
221
|
*
|
|
222
|
-
* Available as `attemptAsyncFlow` and `
|
|
222
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
223
223
|
* @returns Flow function
|
|
224
224
|
*/
|
|
225
225
|
export function attemptAsyncFlow<Fn extends GenericCallback>(
|
|
@@ -230,7 +230,7 @@ export function attemptAsyncFlow<Fn extends GenericCallback>(
|
|
|
230
230
|
/**
|
|
231
231
|
* Create an asynchronous Flow, a function that pipes values through a series of functions
|
|
232
232
|
*
|
|
233
|
-
* Available as `attemptAsyncFlow` and `
|
|
233
|
+
* Available as `attemptAsyncFlow` and `attemptFlow.async`
|
|
234
234
|
* @returns Flow function
|
|
235
235
|
*/
|
|
236
236
|
export function attemptAsyncFlow(
|
|
@@ -264,16 +264,12 @@ export function attemptAsyncFlow(
|
|
|
264
264
|
|
|
265
265
|
/**
|
|
266
266
|
* Create a Flow, a function that attempts to pipe values through a function
|
|
267
|
-
*
|
|
268
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
269
267
|
* @returns Flow function
|
|
270
268
|
*/
|
|
271
269
|
export function attemptFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlow<Fn, ReturnType<Fn>>;
|
|
272
270
|
|
|
273
271
|
/**
|
|
274
272
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
275
|
-
*
|
|
276
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
277
273
|
* @returns Flow function
|
|
278
274
|
*/
|
|
279
275
|
export function attemptFlow<First extends GenericCallback, Second>(
|
|
@@ -283,8 +279,6 @@ export function attemptFlow<First extends GenericCallback, Second>(
|
|
|
283
279
|
|
|
284
280
|
/**
|
|
285
281
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
286
|
-
*
|
|
287
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
288
282
|
* @returns Flow function
|
|
289
283
|
*/
|
|
290
284
|
export function attemptFlow<First extends GenericCallback, Second, Third>(
|
|
@@ -295,8 +289,6 @@ export function attemptFlow<First extends GenericCallback, Second, Third>(
|
|
|
295
289
|
|
|
296
290
|
/**
|
|
297
291
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
298
|
-
*
|
|
299
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
300
292
|
* @returns Flow function
|
|
301
293
|
*/
|
|
302
294
|
export function attemptFlow<First extends GenericCallback, Second, Third, Fourth>(
|
|
@@ -308,8 +300,6 @@ export function attemptFlow<First extends GenericCallback, Second, Third, Fourth
|
|
|
308
300
|
|
|
309
301
|
/**
|
|
310
302
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
311
|
-
*
|
|
312
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
313
303
|
* @returns Flow function
|
|
314
304
|
*/
|
|
315
305
|
export function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(
|
|
@@ -322,8 +312,6 @@ export function attemptFlow<First extends GenericCallback, Second, Third, Fourth
|
|
|
322
312
|
|
|
323
313
|
/**
|
|
324
314
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
325
|
-
*
|
|
326
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
327
315
|
* @returns Flow function
|
|
328
316
|
*/
|
|
329
317
|
export function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(
|
|
@@ -337,8 +325,6 @@ export function attemptFlow<First extends GenericCallback, Second, Third, Fourth
|
|
|
337
325
|
|
|
338
326
|
/**
|
|
339
327
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
340
|
-
*
|
|
341
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
342
328
|
* @returns Flow function
|
|
343
329
|
*/
|
|
344
330
|
export function attemptFlow<
|
|
@@ -361,8 +347,6 @@ export function attemptFlow<
|
|
|
361
347
|
|
|
362
348
|
/**
|
|
363
349
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
364
|
-
*
|
|
365
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
366
350
|
* @returns Flow function
|
|
367
351
|
*/
|
|
368
352
|
export function attemptFlow<
|
|
@@ -387,8 +371,6 @@ export function attemptFlow<
|
|
|
387
371
|
|
|
388
372
|
/**
|
|
389
373
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
390
|
-
*
|
|
391
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
392
374
|
* @returns Flow function
|
|
393
375
|
*/
|
|
394
376
|
export function attemptFlow<
|
|
@@ -415,8 +397,6 @@ export function attemptFlow<
|
|
|
415
397
|
|
|
416
398
|
/**
|
|
417
399
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
418
|
-
*
|
|
419
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
420
400
|
* @returns Flow function
|
|
421
401
|
*/
|
|
422
402
|
export function attemptFlow<
|
|
@@ -445,8 +425,6 @@ export function attemptFlow<
|
|
|
445
425
|
|
|
446
426
|
/**
|
|
447
427
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
448
|
-
*
|
|
449
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
450
428
|
* @returns Flow function
|
|
451
429
|
*/
|
|
452
430
|
export function attemptFlow<First extends GenericCallback>(
|
|
@@ -456,8 +434,6 @@ export function attemptFlow<First extends GenericCallback>(
|
|
|
456
434
|
|
|
457
435
|
/**
|
|
458
436
|
* Create a Flow, a function that attempts to pipe values through a series of functions
|
|
459
|
-
*
|
|
460
|
-
* Available as `attemptFlow` and `attempt.flow`
|
|
461
437
|
* @returns Flow function
|
|
462
438
|
*/
|
|
463
439
|
export function attemptFlow(...fns: GenericCallback[]): (...args: unknown[]) => Result<unknown>;
|
package/src/result/work/pipe.ts
CHANGED
|
@@ -17,7 +17,7 @@ type WrapValue<Value> = Result<UnwrapValue<Value>>;
|
|
|
17
17
|
/**
|
|
18
18
|
* Attempt to pipe a value through a function
|
|
19
19
|
*
|
|
20
|
-
* Available as `attemptAsyncPipe` and `
|
|
20
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
21
21
|
* @param initial Initial value
|
|
22
22
|
* @returns Piped result
|
|
23
23
|
*/
|
|
@@ -29,7 +29,7 @@ export async function attemptAsyncPipe<Initial, Piped>(
|
|
|
29
29
|
/**
|
|
30
30
|
* Attempt to pipe a value through a series of functions
|
|
31
31
|
*
|
|
32
|
-
* Available as `attemptAsyncPipe` and `
|
|
32
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
33
33
|
* @param initial Initial value
|
|
34
34
|
* @returns Piped result
|
|
35
35
|
*/
|
|
@@ -42,7 +42,7 @@ export async function attemptAsyncPipe<Initial, First, Second>(
|
|
|
42
42
|
/**
|
|
43
43
|
* Attempt to pipe a value through a series of functions
|
|
44
44
|
*
|
|
45
|
-
* Available as `attemptAsyncPipe` and `
|
|
45
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
46
46
|
* @param initial Initial value
|
|
47
47
|
* @returns Piped result
|
|
48
48
|
*/
|
|
@@ -56,7 +56,7 @@ export async function attemptAsyncPipe<Initial, First, Second, Third>(
|
|
|
56
56
|
/**
|
|
57
57
|
* Attempt to pipe a value through a series of functions
|
|
58
58
|
*
|
|
59
|
-
* Available as `attemptAsyncPipe` and `
|
|
59
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
60
60
|
* @param initial Initial value
|
|
61
61
|
* @returns Piped result
|
|
62
62
|
*/
|
|
@@ -71,7 +71,7 @@ export async function attemptAsyncPipe<Initial, First, Second, Third, Fourth>(
|
|
|
71
71
|
/**
|
|
72
72
|
* Attempt to pipe a value through a series of functions
|
|
73
73
|
*
|
|
74
|
-
* Available as `attemptAsyncPipe` and `
|
|
74
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
75
75
|
* @param initial Initial value
|
|
76
76
|
* @returns Piped result
|
|
77
77
|
*/
|
|
@@ -87,7 +87,7 @@ export async function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fi
|
|
|
87
87
|
/**
|
|
88
88
|
* Attempt to pipe a value through a series of functions
|
|
89
89
|
*
|
|
90
|
-
* Available as `attemptAsyncPipe` and `
|
|
90
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
91
91
|
* @param initial Initial value
|
|
92
92
|
* @returns Piped result
|
|
93
93
|
*/
|
|
@@ -104,7 +104,7 @@ export async function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fi
|
|
|
104
104
|
/**
|
|
105
105
|
* Attempt to pipe a value through a series of functions
|
|
106
106
|
*
|
|
107
|
-
* Available as `attemptAsyncPipe` and `
|
|
107
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
108
108
|
* @param initial Initial value
|
|
109
109
|
* @returns Piped result
|
|
110
110
|
*/
|
|
@@ -131,7 +131,7 @@ export async function attemptAsyncPipe<
|
|
|
131
131
|
/**
|
|
132
132
|
* Attempt to pipe a value through a series of functions
|
|
133
133
|
*
|
|
134
|
-
* Available as `attemptAsyncPipe` and `
|
|
134
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
135
135
|
* @param initial Initial value
|
|
136
136
|
* @returns Piped result
|
|
137
137
|
*/
|
|
@@ -160,7 +160,7 @@ export async function attemptAsyncPipe<
|
|
|
160
160
|
/**
|
|
161
161
|
* Attempt to pipe a value through a series of functions
|
|
162
162
|
*
|
|
163
|
-
* Available as `attemptAsyncPipe` and `
|
|
163
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
164
164
|
* @param initial Initial value
|
|
165
165
|
* @returns Piped result
|
|
166
166
|
*/
|
|
@@ -191,7 +191,7 @@ export async function attemptAsyncPipe<
|
|
|
191
191
|
/**
|
|
192
192
|
* Attempt to pipe a value through a series of functions
|
|
193
193
|
*
|
|
194
|
-
* Available as `attemptAsyncPipe` and `
|
|
194
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
195
195
|
* @param initial Initial value
|
|
196
196
|
* @returns Piped result
|
|
197
197
|
*/
|
|
@@ -224,7 +224,7 @@ export async function attemptAsyncPipe<
|
|
|
224
224
|
/**
|
|
225
225
|
* Attempt to pipe a result through a series of functions
|
|
226
226
|
*
|
|
227
|
-
* Available as `attemptAsyncPipe` and `
|
|
227
|
+
* Available as `attemptAsyncPipe` and `attemptPipe.async`
|
|
228
228
|
* @param initial Initial result
|
|
229
229
|
* @returns Piped result
|
|
230
230
|
*/
|
|
@@ -265,8 +265,6 @@ export async function attemptAsyncPipe(
|
|
|
265
265
|
|
|
266
266
|
/**
|
|
267
267
|
* Attempt to pipe a value through a function
|
|
268
|
-
*
|
|
269
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
270
268
|
* @param initial Initial value
|
|
271
269
|
* @returns Piped result
|
|
272
270
|
*/
|
|
@@ -277,8 +275,6 @@ export function attemptPipe<Initial, Pipe>(
|
|
|
277
275
|
|
|
278
276
|
/**
|
|
279
277
|
* Attempt to pipe a value through a series of functions
|
|
280
|
-
*
|
|
281
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
282
278
|
* @param initial Initial value
|
|
283
279
|
* @returns Piped result
|
|
284
280
|
*/
|
|
@@ -290,8 +286,6 @@ export function attemptPipe<Initial, First, Second>(
|
|
|
290
286
|
|
|
291
287
|
/**
|
|
292
288
|
* Attempt to pipe a value through a series of functions
|
|
293
|
-
*
|
|
294
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
295
289
|
* @param initial Initial value
|
|
296
290
|
* @returns Piped result
|
|
297
291
|
*/
|
|
@@ -304,8 +298,6 @@ export function attemptPipe<Initial, First, Second, Third>(
|
|
|
304
298
|
|
|
305
299
|
/**
|
|
306
300
|
* Attempt to pipe a value through a series of functions
|
|
307
|
-
*
|
|
308
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
309
301
|
* @param initial Initial value
|
|
310
302
|
* @returns Piped result
|
|
311
303
|
*/
|
|
@@ -319,8 +311,6 @@ export function attemptPipe<Initial, First, Second, Third, Fourth>(
|
|
|
319
311
|
|
|
320
312
|
/**
|
|
321
313
|
* Attempt to pipe a value through a series of functions
|
|
322
|
-
*
|
|
323
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
324
314
|
* @param initial Initial value
|
|
325
315
|
* @returns Piped result
|
|
326
316
|
*/
|
|
@@ -335,8 +325,6 @@ export function attemptPipe<Initial, First, Second, Third, Fourth, Fifth>(
|
|
|
335
325
|
|
|
336
326
|
/**
|
|
337
327
|
* Attempt to pipe a value through a series of functions
|
|
338
|
-
*
|
|
339
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
340
328
|
* @param initial Initial value
|
|
341
329
|
* @returns Piped result
|
|
342
330
|
*/
|
|
@@ -352,8 +340,6 @@ export function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>
|
|
|
352
340
|
|
|
353
341
|
/**
|
|
354
342
|
* Attempt to pipe a value through a series of functions
|
|
355
|
-
*
|
|
356
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
357
343
|
* @param initial Initial value
|
|
358
344
|
* @returns Piped result
|
|
359
345
|
*/
|
|
@@ -370,8 +356,6 @@ export function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth,
|
|
|
370
356
|
|
|
371
357
|
/**
|
|
372
358
|
* Attempt to pipe a value through a series of functions
|
|
373
|
-
*
|
|
374
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
375
359
|
* @param initial Initial value
|
|
376
360
|
* @returns Piped result
|
|
377
361
|
*/
|
|
@@ -389,8 +373,6 @@ export function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth,
|
|
|
389
373
|
|
|
390
374
|
/**
|
|
391
375
|
* Attempt to pipe a value through a series of functions
|
|
392
|
-
*
|
|
393
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
394
376
|
* @param initial Initial value
|
|
395
377
|
* @returns Piped result
|
|
396
378
|
*/
|
|
@@ -420,8 +402,6 @@ export function attemptPipe<
|
|
|
420
402
|
|
|
421
403
|
/**
|
|
422
404
|
* Attempt to pipe a value through a series of functions
|
|
423
|
-
*
|
|
424
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
425
405
|
* @param initial Initial value
|
|
426
406
|
* @returns Piped result
|
|
427
407
|
*/
|
|
@@ -453,8 +433,6 @@ export function attemptPipe<
|
|
|
453
433
|
|
|
454
434
|
/**
|
|
455
435
|
* Attempt to pipe a result through a series of functions
|
|
456
|
-
*
|
|
457
|
-
* Available as `attemptPipe` and `attempt.pipe`
|
|
458
436
|
* @param initial Initial result
|
|
459
437
|
* @returns Piped result
|
|
460
438
|
*/
|
package/src/sized/set.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {getSizedMaximum} from '../internal/sized';
|
|
2
2
|
|
|
3
|
-
// #region Types
|
|
3
|
+
// #region Types
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* A Set with a maximum size
|
|
7
|
+
*
|
|
8
|
+
* Behavior is similar to a _LRU_-cache, where the oldest values are removed
|
|
8
9
|
*/
|
|
9
10
|
export class SizedSet<Value = unknown> extends Set<Value> {
|
|
10
11
|
/**
|
package/src/value/shake.ts
CHANGED
package/src/value/smush.ts
CHANGED
|
@@ -11,6 +11,9 @@ import type {
|
|
|
11
11
|
|
|
12
12
|
// #region Types
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* A smushed object, with all nested objects flattened into a single level, using dot notation keys
|
|
16
|
+
*/
|
|
14
17
|
export type Smushed<Value extends PlainObject> = Simplify<{
|
|
15
18
|
[NestedKey in NestedKeys<Value>]: NestedValue<Value, ToString<NestedKey>>;
|
|
16
19
|
}>;
|
package/src/value/transform.ts
CHANGED
|
@@ -3,15 +3,24 @@ import type {GenericCallback, PlainObject} from '../models';
|
|
|
3
3
|
|
|
4
4
|
// #region Types
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* A callback transform an object's properties
|
|
8
|
+
*/
|
|
6
9
|
type TransformCallback<Value extends PlainObject, Key extends keyof Value> = (
|
|
7
10
|
key: Key,
|
|
8
11
|
value: Value[Key],
|
|
9
12
|
) => Value[Key];
|
|
10
13
|
|
|
14
|
+
/**
|
|
15
|
+
* A collection of keyed callbacks to transform an object's properties
|
|
16
|
+
*/
|
|
11
17
|
type TransformCallbacks<Value extends PlainObject> = Partial<{
|
|
12
18
|
[Key in keyof Value]: (value: Value[Key]) => Value[Key];
|
|
13
19
|
}>;
|
|
14
20
|
|
|
21
|
+
/**
|
|
22
|
+
* A transformer function for an object, with predefined callbacks for transforming its properties
|
|
23
|
+
*/
|
|
15
24
|
export type Transformer<Value extends PlainObject> = {
|
|
16
25
|
(value: Value): Value;
|
|
17
26
|
};
|
package/src/value/unsmush.ts
CHANGED