MCPcopy
hub / github.com/Effect-TS/effect / toString

Method toString

packages/cli/src/internal/prompt/date.ts:543–554  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

541 }
542
543 toString() {
544 const date = this.date.getDate()
545 const day = this.date.getDay()
546 return Match.value(this.token).pipe(
547 Match.when("DD", () => `${date}`.padStart(2, "0")),
548 Match.when("Do", () => `${date}${this.ordinalIndicator(date)}`),
549 Match.when("d", () => `${day + 1}`),
550 Match.when("ddd", () => this.locales!.weekdaysShort[day]!),
551 Match.when("dddd", () => this.locales!.weekdays[day]!),
552 Match.orElse(() => `${date}`)
553 )
554 }
555
556 private ordinalIndicator(day: number): string {
557 return Match.value(day % 10).pipe(

Callers

nothing calls this directly

Calls 3

ordinalIndicatorMethod · 0.95
pipeMethod · 0.65
valueMethod · 0.45

Tested by

no test coverage detected