diff --git a/.changeset/shy-nails-happen.md b/.changeset/shy-nails-happen.md new file mode 100644 index 00000000000..d87745be1b1 --- /dev/null +++ b/.changeset/shy-nails-happen.md @@ -0,0 +1,5 @@ +--- +"effect": patch +--- + +Expose `Schedule.isSchedule` diff --git a/packages/effect/src/Schedule.ts b/packages/effect/src/Schedule.ts index 94b1c2a45aa..77ab4c81dfb 100644 --- a/packages/effect/src/Schedule.ts +++ b/packages/effect/src/Schedule.ts @@ -140,6 +140,14 @@ export const makeWithState: ( ) => Effect.Effect ) => Schedule = internal.makeWithState +/** + * Returns `true` if the specified value is a `Schedule`, `false` otherwise. + * + * @since 2.0.0 + * @category guards + */ +export const isSchedule: (u: unknown) => u is Schedule = internal.isSchedule + /** * Returns a new schedule with the given delay added to every interval defined * by this schedule. diff --git a/packages/effect/src/internal/schedule.ts b/packages/effect/src/internal/schedule.ts index a10da36df9a..34c4c6bfca1 100644 --- a/packages/effect/src/internal/schedule.ts +++ b/packages/effect/src/internal/schedule.ts @@ -34,7 +34,8 @@ export const ScheduleTypeId: Schedule.ScheduleTypeId = Symbol.for( ) as Schedule.ScheduleTypeId /** @internal */ -export const isSchedule = (u: unknown): u is Schedule.Schedule => hasProperty(u, ScheduleTypeId) +export const isSchedule = (u: unknown): u is Schedule.Schedule => + hasProperty(u, ScheduleTypeId) /** @internal */ const ScheduleDriverSymbolKey = "effect/ScheduleDriver"