effect 3.20.1 → 3.21.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/cjs/Cron.js +144 -48
- package/dist/cjs/Cron.js.map +1 -1
- package/dist/cjs/Effect.js +9 -4
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Layer.js +49 -1
- package/dist/cjs/Layer.js.map +1 -1
- package/dist/cjs/RcMap.js +1 -0
- package/dist/cjs/RcMap.js.map +1 -1
- package/dist/cjs/internal/core-effect.js +8 -4
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/fiberRuntime.js +1 -1
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/rcMap.js +11 -6
- package/dist/cjs/internal/rcMap.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Cron.d.ts +29 -1
- package/dist/dts/Cron.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +5 -0
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Layer.d.ts +42 -0
- package/dist/dts/Layer.d.ts.map +1 -1
- package/dist/dts/RcMap.d.ts +5 -2
- package/dist/dts/RcMap.d.ts.map +1 -1
- package/dist/dts/internal/core-effect.d.ts +5 -0
- package/dist/dts/internal/core-effect.d.ts.map +1 -1
- package/dist/dts/internal/fiberRuntime.d.ts.map +1 -1
- package/dist/esm/Cron.js +139 -45
- package/dist/esm/Cron.js.map +1 -1
- package/dist/esm/Effect.js +5 -0
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Layer.js +45 -0
- package/dist/esm/Layer.js.map +1 -1
- package/dist/esm/RcMap.js +1 -0
- package/dist/esm/RcMap.js.map +1 -1
- package/dist/esm/internal/core-effect.js +6 -2
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/fiberRuntime.js +1 -1
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/rcMap.js +12 -7
- package/dist/esm/internal/rcMap.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Cron.ts +175 -45
- package/src/Effect.ts +6 -0
- package/src/Layer.ts +52 -0
- package/src/RcMap.ts +5 -2
- package/src/internal/core-effect.ts +18 -7
- package/src/internal/fiberRuntime.ts +4 -2
- package/src/internal/rcMap.ts +21 -11
- package/src/internal/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rcMap.js","names":["Context","Duration","dual","identity","MutableHashMap","pipeArguments","coreEffect","core","circular","fiberRuntime","TypeId","Symbol","for","variance","_K","_A","_E","RcMapImpl","lookup","context","scope","idleTimeToLive","capacity","state","_tag","map","empty","semaphore","unsafeMakeSemaphore","constructor","pipe","arguments","make","options","withFiberRuntime","fiber","getFiberRef","currentContext","get","scopeTag","self","decode","undefined","Math","max","Number","POSITIVE_INFINITY","as","addFinalizer","suspend","void","forEachSequentialDiscard","entry","scopeClose","exitVoid","tap","clear","withPermits","self_","key","uninterruptibleMask","restore","getImpl","fnUntraced","interrupt","o","value","refCount","isFinite","size","fail","ExceededCapacityException","acquire","finalizer","deferredAwait","deferred","scopeMake","deferredMake","contextMap","Map","unsafeMap","mapInputContext","inputContext","forEach","set","unsafeMake","exit","flatMap","deferredDone","forkIn","expiresAt","release","clockWith","clock","has","remove","unsafeCurrentTimeMillis","toMillis","interruptibleMask","loop","now","remaining","sleep","millis","ensuring","sync","keys","impl","succeed","invalidate","interruptFiber","touch"],"sources":["../../../src/internal/rcMap.ts"],"sourcesContent":[null],"mappings":"AACA,OAAO,KAAKA,OAAO,MAAM,eAAe;AAExC,OAAO,KAAKC,QAAQ,MAAM,gBAAgB;AAG1C,SAASC,IAAI,EAAEC,QAAQ,QAAQ,gBAAgB;AAC/C,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AACtD,SAASC,aAAa,QAAQ,gBAAgB;AAG9C,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C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AI,CAAC,MAAK;IACpB,IAAIjE,IAAI,CAACjB,KAAK,CAACC,IAAI,KAAK,QAAQ,EAAE,OAAO,KAAK;IAC9C,OAAOpB,cAAc,CAAC0F,GAAG,CAACtD,IAAI,CAACjB,KAAK,CAACE,GAAG,EAAEkC,GAAG,CAAC;EAChD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;AACA,OAAO,MAAMoD,KAAK,gBAGd7G,IAAI,CACN,CAAC,EACD,CAAUwD,KAA2B,EAAEC,GAAM,KAC3CrD,UAAU,CAACsF,SAAS,CAAEC,KAAK,IAAI;EAC7B,MAAMrD,IAAI,GAAGkB,KAA2B;EACxC,IAAI,CAAClB,IAAI,CAACnB,cAAc,IAAImB,IAAI,CAACjB,KAAK,CAACC,IAAI,KAAK,QAAQ,EAAE,OAAOjB,IAAI,CAAC2C,IAAI;EAC1E,MAAMe,CAAC,GAAG7D,cAAc,CAACkC,GAAG,CAACE,IAAI,CAACjB,KAAK,CAACE,GAAG,EAAEkC,GAAG,CAAC;EACjD,IAAIM,CAAC,CAACzC,IAAI,KAAK,MAAM,EAAE,OAAOjB,IAAI,CAAC2C,IAAI;EACvCe,CAAC,CAACC,KAAK,CAACwB,SAAS,GAAGG,KAAK,CAACG,uBAAuB,EAAE,GAAG/F,QAAQ,CAACgG,QAAQ,CAACzD,IAAI,CAACnB,cAAc,CAAC;EAC5F,OAAOd,IAAI,CAAC2C,IAAI;AAClB,CAAC,CAAC,CACL","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"rcMap.js","names":["Context","Duration","constant","dual","flow","identity","MutableHashMap","pipeArguments","coreEffect","core","circular","fiberRuntime","TypeId","Symbol","for","variance","_K","_A","_E","RcMapImpl","lookup","context","scope","idleTimeToLive","capacity","state","_tag","map","empty","semaphore","unsafeMakeSemaphore","constructor","pipe","arguments","make","options","withFiberRuntime","fiber","getFiberRef","currentContext","get","scopeTag","undefined","decode","self","Math","max","Number","POSITIVE_INFINITY","as","addFinalizer","suspend","void","forEachSequentialDiscard","entry","scopeClose","exitVoid","tap","clear","withPermits","self_","key","uninterruptibleMask","restore","getImpl","fnUntraced","interrupt","o","value","refCount","isFinite","size","fail","ExceededCapacityException","acquire","finalizer","deferredAwait","deferred","scopeMake","deferredMake","contextMap","Map","unsafeMap","mapInputContext","inputContext","forEach","set","unsafeMake","exit","flatMap","deferredDone","forkIn","zero","expiresAt","release","clockWith","clock","has","isZero","remove","unsafeCurrentTimeMillis","toMillis","interruptibleMask","loop","now","remaining","sleep","millis","ensuring","sync","keys","impl","succeed","invalidate","interruptFiber","touch"],"sources":["../../../src/internal/rcMap.ts"],"sourcesContent":[null],"mappings":"AACA,OAAO,KAAKA,OAAO,MAAM,eAAe;AAExC,OAAO,KAAKC,QAAQ,MAAM,gBAAgB;AAG1C,SAASC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,gBAAgB;AAC/D,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AACtD,SAASC,aAAa,QAAQ,gBAAgB;AAG9C,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAO,KAAKC,QAAQ,MAAM,sBAAsB;AAChD,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAEjD;AACA,OAAO,MAAMC,MAAM,gBAAiBC,MAAM,CAACC,GAAG,CAAC,cAAc,CAAiB;AAyB9E,MAAMC,QAAQ,GAAwC;EACpDC,EAAE,EAAEX,QAAQ;EACZY,EAAE,EAAEZ,QAAQ;EACZa,EAAE,EAAEb;CACL;AAED,MAAMc,SAAS;EAUFC,MAAA;EACAC,OAAA;EACAC,KAAA;EACAC,cAAA;EACAC,QAAA;EAbF,CAACZ,MAAM;EAEhBa,KAAK,GAAmB;IACtBC,IAAI,EAAE,MAAM;IACZC,GAAG,eAAErB,cAAc,CAACsB,KAAK;GAC1B;EACQC,SAAS,gBAAGnB,QAAQ,CAACoB,mBAAmB,CAAC,CAAC,CAAC;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AC,CAAC;AACJ,CAAC,CAAC;AAEF;AACA,OAAO,MAAMsD,KAAK,gBAGdhH,IAAI,CACN,CAAC,EACD,CAAUyD,KAA2B,EAAEC,GAAM,KAC3CrD,UAAU,CAACuF,SAAS,CAAEC,KAAK,IAAI;EAC7B,MAAMpD,IAAI,GAAGgB,KAA2B;EACxC,IAAIhB,IAAI,CAACnB,KAAK,CAACC,IAAI,KAAK,QAAQ,EAAE,OAAOjB,IAAI,CAAC2C,IAAI;EAClD,MAAMe,CAAC,GAAG7D,cAAc,CAACkC,GAAG,CAACI,IAAI,CAACnB,KAAK,CAACE,GAAG,EAAEkC,GAAG,CAAC;EACjD,IAAIM,CAAC,CAACzC,IAAI,KAAK,MAAM,EAAE,OAAOjB,IAAI,CAAC2C,IAAI;EACvC,MAAME,KAAK,GAAGa,CAAC,CAACC,KAAK;EACrB,IAAInE,QAAQ,CAACiG,MAAM,CAAC5C,KAAK,CAAC/B,cAAc,CAAC,EAAE,OAAOd,IAAI,CAAC2C,IAAI;EAC3DE,KAAK,CAACuC,SAAS,GAAGG,KAAK,CAACI,uBAAuB,EAAE,GAAGnG,QAAQ,CAACoG,QAAQ,CAAC/C,KAAK,CAAC/B,cAAc,CAAC;EAC3F,OAAOd,IAAI,CAAC2C,IAAI;AAClB,CAAC,CAAC,CACL","ignoreList":[]}
|
package/package.json
CHANGED
package/src/Cron.ts
CHANGED
|
@@ -53,6 +53,15 @@ export interface Cron extends Pipeable, Equal.Equal, Inspectable {
|
|
|
53
53
|
readonly weekday: number
|
|
54
54
|
}
|
|
55
55
|
/** @internal */
|
|
56
|
+
readonly last: {
|
|
57
|
+
readonly second: number
|
|
58
|
+
readonly minute: number
|
|
59
|
+
readonly hour: number
|
|
60
|
+
readonly day: number
|
|
61
|
+
readonly month: number
|
|
62
|
+
readonly weekday: number
|
|
63
|
+
}
|
|
64
|
+
/** @internal */
|
|
56
65
|
readonly next: {
|
|
57
66
|
readonly second: ReadonlyArray<number | undefined>
|
|
58
67
|
readonly minute: ReadonlyArray<number | undefined>
|
|
@@ -61,6 +70,15 @@ export interface Cron extends Pipeable, Equal.Equal, Inspectable {
|
|
|
61
70
|
readonly month: ReadonlyArray<number | undefined>
|
|
62
71
|
readonly weekday: ReadonlyArray<number | undefined>
|
|
63
72
|
}
|
|
73
|
+
/** @internal */
|
|
74
|
+
readonly prev: {
|
|
75
|
+
readonly second: ReadonlyArray<number | undefined>
|
|
76
|
+
readonly minute: ReadonlyArray<number | undefined>
|
|
77
|
+
readonly hour: ReadonlyArray<number | undefined>
|
|
78
|
+
readonly day: ReadonlyArray<number | undefined>
|
|
79
|
+
readonly month: ReadonlyArray<number | undefined>
|
|
80
|
+
readonly weekday: ReadonlyArray<number | undefined>
|
|
81
|
+
}
|
|
64
82
|
}
|
|
65
83
|
|
|
66
84
|
const CronProto = {
|
|
@@ -151,31 +169,64 @@ export const make = (values: {
|
|
|
151
169
|
weekday: weekdays[0] ?? 0
|
|
152
170
|
}
|
|
153
171
|
|
|
172
|
+
o.last = {
|
|
173
|
+
second: seconds[seconds.length - 1] ?? 59,
|
|
174
|
+
minute: minutes[minutes.length - 1] ?? 59,
|
|
175
|
+
hour: hours[hours.length - 1] ?? 23,
|
|
176
|
+
day: days[days.length - 1] ?? 31,
|
|
177
|
+
month: (months[months.length - 1] ?? 12) - 1,
|
|
178
|
+
weekday: weekdays[weekdays.length - 1] ?? 6
|
|
179
|
+
}
|
|
180
|
+
|
|
154
181
|
o.next = {
|
|
155
|
-
second:
|
|
156
|
-
minute:
|
|
157
|
-
hour:
|
|
158
|
-
day:
|
|
159
|
-
month:
|
|
160
|
-
weekday:
|
|
182
|
+
second: lookupTable(seconds, 60, "next"),
|
|
183
|
+
minute: lookupTable(minutes, 60, "next"),
|
|
184
|
+
hour: lookupTable(hours, 24, "next"),
|
|
185
|
+
day: lookupTable(days, 32, "next"),
|
|
186
|
+
month: lookupTable(months, 13, "next"),
|
|
187
|
+
weekday: lookupTable(weekdays, 7, "next")
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
o.prev = {
|
|
191
|
+
second: lookupTable(seconds, 60, "prev"),
|
|
192
|
+
minute: lookupTable(minutes, 60, "prev"),
|
|
193
|
+
hour: lookupTable(hours, 24, "prev"),
|
|
194
|
+
day: lookupTable(days, 32, "prev"),
|
|
195
|
+
month: lookupTable(months, 13, "prev"),
|
|
196
|
+
weekday: lookupTable(weekdays, 7, "prev")
|
|
161
197
|
}
|
|
162
198
|
|
|
163
199
|
return o
|
|
164
200
|
}
|
|
165
201
|
|
|
166
|
-
const
|
|
202
|
+
const lookupTable = (
|
|
203
|
+
values: ReadonlyArray<number>,
|
|
204
|
+
size: number,
|
|
205
|
+
dir: "next" | "prev"
|
|
206
|
+
): Array<number | undefined> => {
|
|
167
207
|
const result = new Array(size).fill(undefined)
|
|
168
208
|
if (values.length === 0) {
|
|
169
209
|
return result
|
|
170
210
|
}
|
|
171
211
|
|
|
172
212
|
let current: number | undefined = undefined
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
213
|
+
|
|
214
|
+
if (dir === "next") {
|
|
215
|
+
let index = values.length - 1
|
|
216
|
+
for (let i = size - 1; i >= 0; i--) {
|
|
217
|
+
while (index >= 0 && values[index] >= i) {
|
|
218
|
+
current = values[index--]
|
|
219
|
+
}
|
|
220
|
+
result[i] = current
|
|
221
|
+
}
|
|
222
|
+
} else {
|
|
223
|
+
let index = 0
|
|
224
|
+
for (let i = 0; i < size; i++) {
|
|
225
|
+
while (index < values.length && values[index] <= i) {
|
|
226
|
+
current = values[index++]
|
|
227
|
+
}
|
|
228
|
+
result[i] = current
|
|
177
229
|
}
|
|
178
|
-
result[i] = current
|
|
179
230
|
}
|
|
180
231
|
|
|
181
232
|
return result
|
|
@@ -376,7 +427,7 @@ const daysInMonth = (date: Date): number =>
|
|
|
376
427
|
/**
|
|
377
428
|
* Returns the next run `Date` for the given `Cron` instance.
|
|
378
429
|
*
|
|
379
|
-
* Uses the current time as a starting point if no value is provided for `
|
|
430
|
+
* Uses the current time as a starting point if no value is provided for `startFrom`.
|
|
380
431
|
*
|
|
381
432
|
* @example
|
|
382
433
|
* ```ts
|
|
@@ -394,38 +445,76 @@ const daysInMonth = (date: Date): number =>
|
|
|
394
445
|
* @since 2.0.0
|
|
395
446
|
*/
|
|
396
447
|
export const next = (cron: Cron, startFrom?: DateTime.DateTime.Input): Date => {
|
|
448
|
+
return stepCron(cron, startFrom, "next")
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Returns the previous run `Date` for the given `Cron` instance.
|
|
453
|
+
*
|
|
454
|
+
* Uses the current time as a starting point if no value is provided for `startFrom`.
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```ts
|
|
458
|
+
* import * as assert from "node:assert"
|
|
459
|
+
* import { Cron, Either } from "effect"
|
|
460
|
+
*
|
|
461
|
+
* const before = new Date("2021-01-15 00:00:00")
|
|
462
|
+
* const cron = Either.getOrThrow(Cron.parse("0 4 8-14 * *"))
|
|
463
|
+
* assert.deepStrictEqual(Cron.prev(cron, before), new Date("2021-01-14 04:00:00"))
|
|
464
|
+
* ```
|
|
465
|
+
*
|
|
466
|
+
* @throws `IllegalArgumentException` if the given `DateTime.Input` is invalid.
|
|
467
|
+
* @throws `Error` if the previous run date cannot be found within 10,000 iterations.
|
|
468
|
+
*
|
|
469
|
+
* @since 3.20.0
|
|
470
|
+
*/
|
|
471
|
+
export const prev = (cron: Cron, startFrom?: DateTime.DateTime.Input): Date => {
|
|
472
|
+
return stepCron(cron, startFrom, "prev")
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** @internal */
|
|
476
|
+
const stepCron = (cron: Cron, startFrom: DateTime.DateTime.Input | undefined, direction: "next" | "prev"): Date => {
|
|
397
477
|
const tz = Option.getOrUndefined(cron.tz)
|
|
398
478
|
const zoned = dateTime.unsafeMakeZoned(startFrom ?? new Date(), {
|
|
399
479
|
timeZone: tz
|
|
400
480
|
})
|
|
401
481
|
|
|
482
|
+
const prev = direction === "prev"
|
|
483
|
+
const tick = prev ? -1 : 1
|
|
484
|
+
const table = cron[direction]
|
|
485
|
+
const boundary = prev ? cron.last : cron.first
|
|
486
|
+
|
|
487
|
+
const needsStep = prev
|
|
488
|
+
? (next: number, current: number) => next < current
|
|
489
|
+
: (next: number, current: number) => next > current
|
|
490
|
+
|
|
402
491
|
const utc = tz !== undefined && dateTime.isTimeZoneNamed(tz) && tz.id === "UTC"
|
|
403
492
|
const adjustDst = utc ? constVoid : (current: Date) => {
|
|
404
493
|
const adjusted = dateTime.unsafeMakeZoned(current, {
|
|
405
494
|
timeZone: zoned.zone,
|
|
406
|
-
adjustForTimeZone: true
|
|
495
|
+
adjustForTimeZone: true,
|
|
496
|
+
disambiguation: prev ? "later" : undefined
|
|
407
497
|
}).pipe(dateTime.toDate)
|
|
408
498
|
|
|
409
|
-
// TODO: This implementation currently only skips forward when transitioning into daylight savings time.
|
|
410
499
|
const drift = current.getTime() - adjusted.getTime()
|
|
411
|
-
if (drift > 0) {
|
|
412
|
-
current.setTime(
|
|
500
|
+
if (prev ? drift !== 0 : drift > 0) {
|
|
501
|
+
current.setTime(adjusted.getTime())
|
|
413
502
|
}
|
|
414
503
|
}
|
|
415
504
|
|
|
416
505
|
const result = dateTime.mutate(zoned, (current) => {
|
|
417
|
-
current.setUTCSeconds(current.getUTCSeconds() +
|
|
506
|
+
current.setUTCSeconds(current.getUTCSeconds() + tick, 0)
|
|
418
507
|
|
|
419
508
|
for (let i = 0; i < 10_000; i++) {
|
|
420
509
|
if (cron.seconds.size !== 0) {
|
|
421
510
|
const currentSecond = current.getUTCSeconds()
|
|
422
|
-
const nextSecond =
|
|
511
|
+
const nextSecond = table.second[currentSecond]
|
|
423
512
|
if (nextSecond === undefined) {
|
|
424
|
-
current.setUTCMinutes(current.getUTCMinutes() +
|
|
513
|
+
current.setUTCMinutes(current.getUTCMinutes() + tick, boundary.second)
|
|
425
514
|
adjustDst(current)
|
|
426
515
|
continue
|
|
427
516
|
}
|
|
428
|
-
if (nextSecond
|
|
517
|
+
if (needsStep(nextSecond, currentSecond)) {
|
|
429
518
|
current.setUTCSeconds(nextSecond)
|
|
430
519
|
adjustDst(current)
|
|
431
520
|
continue
|
|
@@ -434,14 +523,14 @@ export const next = (cron: Cron, startFrom?: DateTime.DateTime.Input): Date => {
|
|
|
434
523
|
|
|
435
524
|
if (cron.minutes.size !== 0) {
|
|
436
525
|
const currentMinute = current.getUTCMinutes()
|
|
437
|
-
const nextMinute =
|
|
526
|
+
const nextMinute = table.minute[currentMinute]
|
|
438
527
|
if (nextMinute === undefined) {
|
|
439
|
-
current.setUTCHours(current.getUTCHours() +
|
|
528
|
+
current.setUTCHours(current.getUTCHours() + tick, boundary.minute, boundary.second)
|
|
440
529
|
adjustDst(current)
|
|
441
530
|
continue
|
|
442
531
|
}
|
|
443
|
-
if (nextMinute
|
|
444
|
-
current.setUTCMinutes(nextMinute,
|
|
532
|
+
if (needsStep(nextMinute, currentMinute)) {
|
|
533
|
+
current.setUTCMinutes(nextMinute, boundary.second)
|
|
445
534
|
adjustDst(current)
|
|
446
535
|
continue
|
|
447
536
|
}
|
|
@@ -449,40 +538,61 @@ export const next = (cron: Cron, startFrom?: DateTime.DateTime.Input): Date => {
|
|
|
449
538
|
|
|
450
539
|
if (cron.hours.size !== 0) {
|
|
451
540
|
const currentHour = current.getUTCHours()
|
|
452
|
-
const nextHour =
|
|
541
|
+
const nextHour = table.hour[currentHour]
|
|
453
542
|
if (nextHour === undefined) {
|
|
454
|
-
current.setUTCDate(current.getUTCDate() +
|
|
455
|
-
current.setUTCHours(
|
|
543
|
+
current.setUTCDate(current.getUTCDate() + tick)
|
|
544
|
+
current.setUTCHours(boundary.hour, boundary.minute, boundary.second)
|
|
456
545
|
adjustDst(current)
|
|
457
546
|
continue
|
|
458
547
|
}
|
|
459
|
-
if (nextHour
|
|
460
|
-
current.setUTCHours(nextHour,
|
|
548
|
+
if (needsStep(nextHour, currentHour)) {
|
|
549
|
+
current.setUTCHours(nextHour, boundary.minute, boundary.second)
|
|
461
550
|
adjustDst(current)
|
|
462
551
|
continue
|
|
463
552
|
}
|
|
464
553
|
}
|
|
465
554
|
|
|
466
555
|
if (cron.weekdays.size !== 0 || cron.days.size !== 0) {
|
|
467
|
-
let a: number = Infinity
|
|
468
|
-
let b: number = Infinity
|
|
556
|
+
let a: number = prev ? -Infinity : Infinity
|
|
557
|
+
let b: number = prev ? -Infinity : Infinity
|
|
469
558
|
|
|
470
559
|
if (cron.weekdays.size !== 0) {
|
|
471
560
|
const currentWeekday = current.getUTCDay()
|
|
472
|
-
const nextWeekday =
|
|
473
|
-
|
|
561
|
+
const nextWeekday = table.weekday[currentWeekday]
|
|
562
|
+
if (nextWeekday === undefined) {
|
|
563
|
+
a = prev
|
|
564
|
+
? currentWeekday - 7 + boundary.weekday
|
|
565
|
+
: 7 - currentWeekday + boundary.weekday
|
|
566
|
+
} else {
|
|
567
|
+
a = nextWeekday - currentWeekday
|
|
568
|
+
}
|
|
474
569
|
}
|
|
475
570
|
|
|
571
|
+
// Only check day-of-month if weekday constraint not already satisfied (they're OR'd)
|
|
476
572
|
if (cron.days.size !== 0 && a !== 0) {
|
|
477
573
|
const currentDay = current.getUTCDate()
|
|
478
|
-
const nextDay =
|
|
479
|
-
|
|
574
|
+
const nextDay = table.day[currentDay]
|
|
575
|
+
if (nextDay === undefined) {
|
|
576
|
+
if (prev) {
|
|
577
|
+
// When wrapping to previous month, calculate days back:
|
|
578
|
+
// Current day offset + gap from end of prev month to target day
|
|
579
|
+
// Example: June 3 → May 20 with boundary.day=20: -(3 + (31 - 20)) = -14
|
|
580
|
+
const prevMonthDays = daysInMonth(
|
|
581
|
+
new Date(Date.UTC(current.getUTCFullYear(), current.getUTCMonth(), 0))
|
|
582
|
+
)
|
|
583
|
+
b = -(currentDay + (prevMonthDays - boundary.day))
|
|
584
|
+
} else {
|
|
585
|
+
b = daysInMonth(current) - currentDay + boundary.day
|
|
586
|
+
}
|
|
587
|
+
} else {
|
|
588
|
+
b = nextDay - currentDay
|
|
589
|
+
}
|
|
480
590
|
}
|
|
481
591
|
|
|
482
|
-
const addDays = Math.min(a, b)
|
|
592
|
+
const addDays = prev ? Math.max(a, b) : Math.min(a, b)
|
|
483
593
|
if (addDays !== 0) {
|
|
484
594
|
current.setUTCDate(current.getUTCDate() + addDays)
|
|
485
|
-
current.setUTCHours(
|
|
595
|
+
current.setUTCHours(boundary.hour, boundary.minute, boundary.second)
|
|
486
596
|
adjustDst(current)
|
|
487
597
|
continue
|
|
488
598
|
}
|
|
@@ -490,17 +600,25 @@ export const next = (cron: Cron, startFrom?: DateTime.DateTime.Input): Date => {
|
|
|
490
600
|
|
|
491
601
|
if (cron.months.size !== 0) {
|
|
492
602
|
const currentMonth = current.getUTCMonth() + 1
|
|
493
|
-
const nextMonth =
|
|
603
|
+
const nextMonth = table.month[currentMonth]
|
|
604
|
+
const clampBoundaryDay = (targetMonthIndex: number): number => {
|
|
605
|
+
if (cron.days.size !== 0) {
|
|
606
|
+
return boundary.day
|
|
607
|
+
}
|
|
608
|
+
const maxDayInMonth = daysInMonth(new Date(Date.UTC(current.getUTCFullYear(), targetMonthIndex, 1)))
|
|
609
|
+
return Math.min(boundary.day, maxDayInMonth)
|
|
610
|
+
}
|
|
494
611
|
if (nextMonth === undefined) {
|
|
495
|
-
current.setUTCFullYear(current.getUTCFullYear() +
|
|
496
|
-
current.setUTCMonth(
|
|
497
|
-
current.setUTCHours(
|
|
612
|
+
current.setUTCFullYear(current.getUTCFullYear() + tick)
|
|
613
|
+
current.setUTCMonth(boundary.month, clampBoundaryDay(boundary.month))
|
|
614
|
+
current.setUTCHours(boundary.hour, boundary.minute, boundary.second)
|
|
498
615
|
adjustDst(current)
|
|
499
616
|
continue
|
|
500
617
|
}
|
|
501
|
-
if (nextMonth
|
|
502
|
-
|
|
503
|
-
current.
|
|
618
|
+
if (needsStep(nextMonth, currentMonth)) {
|
|
619
|
+
const targetMonthIndex = nextMonth - 1
|
|
620
|
+
current.setUTCMonth(targetMonthIndex, clampBoundaryDay(targetMonthIndex))
|
|
621
|
+
current.setUTCHours(boundary.hour, boundary.minute, boundary.second)
|
|
504
622
|
adjustDst(current)
|
|
505
623
|
continue
|
|
506
624
|
}
|
|
@@ -526,6 +644,18 @@ export const sequence = function*(cron: Cron, startFrom?: DateTime.DateTime.Inpu
|
|
|
526
644
|
}
|
|
527
645
|
}
|
|
528
646
|
|
|
647
|
+
/**
|
|
648
|
+
* Returns an `IterableIterator` which yields the sequence of `Date`s that match the `Cron` instance,
|
|
649
|
+
* in reverse direction.
|
|
650
|
+
*
|
|
651
|
+
* @since 3.20.0
|
|
652
|
+
*/
|
|
653
|
+
export const sequenceReverse = function*(cron: Cron, startFrom?: DateTime.DateTime.Input): IterableIterator<Date> {
|
|
654
|
+
while (true) {
|
|
655
|
+
yield startFrom = prev(cron, startFrom)
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
529
659
|
/**
|
|
530
660
|
* @category instances
|
|
531
661
|
* @since 2.0.0
|
package/src/Effect.ts
CHANGED
|
@@ -27148,6 +27148,12 @@ export const annotateCurrentSpan: {
|
|
|
27148
27148
|
*/
|
|
27149
27149
|
export const currentSpan: Effect<Tracer.Span, Cause.NoSuchElementException> = effect.currentSpan
|
|
27150
27150
|
|
|
27151
|
+
/**
|
|
27152
|
+
* @since 3.20.0
|
|
27153
|
+
* @category Tracing
|
|
27154
|
+
*/
|
|
27155
|
+
export const currentPropagatedSpan: Effect<Tracer.Span, Cause.NoSuchElementException> = effect.currentPropagatedSpan
|
|
27156
|
+
|
|
27151
27157
|
/**
|
|
27152
27158
|
* @since 2.0.0
|
|
27153
27159
|
* @category Tracing
|
package/src/Layer.ts
CHANGED
|
@@ -1669,3 +1669,55 @@ export const updateService = dual<
|
|
|
1669
1669
|
layer,
|
|
1670
1670
|
map(context(), (c) => Context.add(c, tag, f(Context.unsafeGet(c, tag))))
|
|
1671
1671
|
))
|
|
1672
|
+
|
|
1673
|
+
// -----------------------------------------------------------------------------
|
|
1674
|
+
// Type constraints
|
|
1675
|
+
// -----------------------------------------------------------------------------
|
|
1676
|
+
|
|
1677
|
+
/**
|
|
1678
|
+
* A no-op type constraint that enforces the success channel of a Layer conforms to
|
|
1679
|
+
* the specified success type `ROut`.
|
|
1680
|
+
*
|
|
1681
|
+
* @example
|
|
1682
|
+
* import { Layer } from "effect"
|
|
1683
|
+
*
|
|
1684
|
+
* // Ensure that the layer produces the expected services.
|
|
1685
|
+
* const program = Layer.succeed(MyService, new MyServiceImpl()).pipe(Layer.ensureSuccessType<MyService>())
|
|
1686
|
+
*
|
|
1687
|
+
* @since 3.20.0
|
|
1688
|
+
* @category Type constraints
|
|
1689
|
+
*/
|
|
1690
|
+
export const ensureSuccessType =
|
|
1691
|
+
<ROut>() => <ROut2 extends ROut, E, RIn>(layer: Layer<ROut2, E, RIn>): Layer<ROut2, E, RIn> => layer
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* A no-op type constraint that enforces the error channel of a Layer conforms to
|
|
1695
|
+
* the specified error type `E`.
|
|
1696
|
+
*
|
|
1697
|
+
* @example
|
|
1698
|
+
* import { Layer } from "effect"
|
|
1699
|
+
*
|
|
1700
|
+
* // Ensure that the layer does not expose any unhandled errors.
|
|
1701
|
+
* const program = Layer.succeed(MyService, new MyServiceImpl()).pipe(Layer.ensureErrorType<never>())
|
|
1702
|
+
*
|
|
1703
|
+
* @since 3.20.0
|
|
1704
|
+
* @category Type constraints
|
|
1705
|
+
*/
|
|
1706
|
+
export const ensureErrorType = <E>() => <ROut, E2 extends E, RIn>(layer: Layer<ROut, E2, RIn>): Layer<ROut, E2, RIn> =>
|
|
1707
|
+
layer
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* A no-op type constraint that enforces the requirements channel of a Layer conforms to
|
|
1711
|
+
* the specified requirements type `RIn`.
|
|
1712
|
+
*
|
|
1713
|
+
* @example
|
|
1714
|
+
* import { Layer } from "effect"
|
|
1715
|
+
*
|
|
1716
|
+
* // Ensure that the layer does not have any requirements.
|
|
1717
|
+
* const program = Layer.succeed(MyService, new MyServiceImpl()).pipe(Layer.ensureRequirementsType<never>())
|
|
1718
|
+
*
|
|
1719
|
+
* @since 3.20.0
|
|
1720
|
+
* @category Type constraints
|
|
1721
|
+
*/
|
|
1722
|
+
export const ensureRequirementsType =
|
|
1723
|
+
<RIn>() => <ROut, E, RIn2 extends RIn>(layer: Layer<ROut, E, RIn2>): Layer<ROut, E, RIn2> => layer
|
package/src/RcMap.ts
CHANGED
|
@@ -56,6 +56,7 @@ export declare namespace RcMap {
|
|
|
56
56
|
*
|
|
57
57
|
* - `capacity`: The maximum number of resources that can be held in the map.
|
|
58
58
|
* - `idleTimeToLive`: When the reference count reaches zero, the resource will be released after this duration.
|
|
59
|
+
* Can be a static duration or a function that returns a duration based on the key.
|
|
59
60
|
*
|
|
60
61
|
* @since 3.5.0
|
|
61
62
|
* @category models
|
|
@@ -93,6 +94,7 @@ export const make: {
|
|
|
93
94
|
*
|
|
94
95
|
* - `capacity`: The maximum number of resources that can be held in the map.
|
|
95
96
|
* - `idleTimeToLive`: When the reference count reaches zero, the resource will be released after this duration.
|
|
97
|
+
* Can be a static duration or a function that returns a duration based on the key.
|
|
96
98
|
*
|
|
97
99
|
* @since 3.5.0
|
|
98
100
|
* @category models
|
|
@@ -121,7 +123,7 @@ export const make: {
|
|
|
121
123
|
<K, A, E, R>(
|
|
122
124
|
options: {
|
|
123
125
|
readonly lookup: (key: K) => Effect.Effect<A, E, R>
|
|
124
|
-
readonly idleTimeToLive?: Duration.DurationInput | undefined
|
|
126
|
+
readonly idleTimeToLive?: Duration.DurationInput | ((key: K) => Duration.DurationInput) | undefined
|
|
125
127
|
readonly capacity?: undefined
|
|
126
128
|
}
|
|
127
129
|
): Effect.Effect<RcMap<K, A, E>, never, Scope.Scope | R>
|
|
@@ -136,6 +138,7 @@ export const make: {
|
|
|
136
138
|
*
|
|
137
139
|
* - `capacity`: The maximum number of resources that can be held in the map.
|
|
138
140
|
* - `idleTimeToLive`: When the reference count reaches zero, the resource will be released after this duration.
|
|
141
|
+
* Can be a static duration or a function that returns a duration based on the key.
|
|
139
142
|
*
|
|
140
143
|
* @since 3.5.0
|
|
141
144
|
* @category models
|
|
@@ -164,7 +167,7 @@ export const make: {
|
|
|
164
167
|
<K, A, E, R>(
|
|
165
168
|
options: {
|
|
166
169
|
readonly lookup: (key: K) => Effect.Effect<A, E, R>
|
|
167
|
-
readonly idleTimeToLive?: Duration.DurationInput | undefined
|
|
170
|
+
readonly idleTimeToLive?: Duration.DurationInput | ((key: K) => Duration.DurationInput) | undefined
|
|
168
171
|
readonly capacity: number
|
|
169
172
|
}
|
|
170
173
|
): Effect.Effect<RcMap<K, A, E | Cause.ExceededCapacityException>, never, Scope.Scope | R>
|
|
@@ -1966,7 +1966,7 @@ export const annotateCurrentSpan: {
|
|
|
1966
1966
|
} = function(): Effect.Effect<void> {
|
|
1967
1967
|
const args = arguments
|
|
1968
1968
|
return ignore(core.flatMap(
|
|
1969
|
-
|
|
1969
|
+
currentPropagatedSpan,
|
|
1970
1970
|
(span) =>
|
|
1971
1971
|
core.sync(() => {
|
|
1972
1972
|
if (typeof args[0] === "string") {
|
|
@@ -2041,6 +2041,16 @@ export const currentSpan: Effect.Effect<Tracer.Span, Cause.NoSuchElementExceptio
|
|
|
2041
2041
|
}
|
|
2042
2042
|
)
|
|
2043
2043
|
|
|
2044
|
+
export const currentPropagatedSpan: Effect.Effect<Tracer.Span, Cause.NoSuchElementException> = core.flatMap(
|
|
2045
|
+
core.context<never>(),
|
|
2046
|
+
(context) => {
|
|
2047
|
+
const span = filterDisablePropagation(Context.getOption(context, internalTracer.spanTag))
|
|
2048
|
+
return span._tag === "Some" && span.value._tag === "Span"
|
|
2049
|
+
? core.succeed(span.value)
|
|
2050
|
+
: core.fail(new core.NoSuchElementException())
|
|
2051
|
+
}
|
|
2052
|
+
)
|
|
2053
|
+
|
|
2044
2054
|
/* @internal */
|
|
2045
2055
|
export const linkSpans = dual<
|
|
2046
2056
|
(
|
|
@@ -2070,12 +2080,13 @@ export const linkSpans = dual<
|
|
|
2070
2080
|
|
|
2071
2081
|
const bigint0 = BigInt(0)
|
|
2072
2082
|
|
|
2073
|
-
const filterDisablePropagation: (self: Option.Option<Tracer.AnySpan>) => Option.Option<Tracer.AnySpan> = Option
|
|
2074
|
-
(
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
)
|
|
2083
|
+
export const filterDisablePropagation: (self: Option.Option<Tracer.AnySpan>) => Option.Option<Tracer.AnySpan> = Option
|
|
2084
|
+
.flatMap(
|
|
2085
|
+
(span) =>
|
|
2086
|
+
Context.get(span.context, internalTracer.DisablePropagation)
|
|
2087
|
+
? span._tag === "Span" ? filterDisablePropagation(span.parent) : Option.none()
|
|
2088
|
+
: Option.some(span)
|
|
2089
|
+
)
|
|
2079
2090
|
|
|
2080
2091
|
/** @internal */
|
|
2081
2092
|
export const unsafeMakeSpan = <XA, XE>(
|
|
@@ -1522,13 +1522,15 @@ export const tracerLogger = globalValue(
|
|
|
1522
1522
|
logLevel,
|
|
1523
1523
|
message
|
|
1524
1524
|
}) => {
|
|
1525
|
-
const span = Context.getOption(
|
|
1525
|
+
const span = internalEffect.filterDisablePropagation(Context.getOption(
|
|
1526
1526
|
fiberRefs.getOrDefault(context, core.currentContext),
|
|
1527
1527
|
tracer.spanTag
|
|
1528
|
-
)
|
|
1528
|
+
))
|
|
1529
|
+
|
|
1529
1530
|
if (span._tag === "None" || span.value._tag === "ExternalSpan") {
|
|
1530
1531
|
return
|
|
1531
1532
|
}
|
|
1533
|
+
|
|
1532
1534
|
const clockService = Context.unsafeGet(
|
|
1533
1535
|
fiberRefs.getOrDefault(context, defaultServices.currentServices),
|
|
1534
1536
|
clock.clockTag
|