MCPcopy Create free account
hub / github.com/Effect-TS/effect / format

Function format

packages/effect/src/Cron.ts:719–727  ·  view source on GitHub ↗
(cron: Cron, options?: {
  readonly includeSeconds?: boolean | undefined
})

Source from the content-addressed store, hash-verified

717 * @since 4.0.0
718 */
719export const format = (cron: Cron, options?: {
720 readonly includeSeconds?: boolean | undefined
721}): string => {
722 const segments = [cron.seconds, cron.minutes, cron.hours, cron.days, cron.months, cron.weekdays]
723 .map(formatSegment)
724 return (
725 options?.includeSeconds !== true && cron.seconds.size === 1 && cron.seconds.has(0) ? segments.slice(1) : segments
726 ).join(" ")
727}
728
729const formatSegment = (values: ReadonlySet<number>): string => {
730 if (values.size === 0) {

Callers 15

toStringFunction · 0.90
formatInputFunction · 0.90
toStringFunction · 0.90
constructorMethod · 0.90
toStringFunction · 0.90
toStringFunction · 0.90
toStringFunction · 0.90
toStringUnknownFunction · 0.90
toStringFunction · 0.90
toStringFunction · 0.90
encodeNumberPayloadFunction · 0.90
encodeDatePayloadFunction · 0.90

Calls 4

sliceMethod · 0.80
hasMethod · 0.65
mapMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected