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

Function previousPart

packages/effect/src/unstable/cli/Prompt.ts:1857–1863  ·  view source on GitHub ↗

* Retrieves the previous date part in the list of parts.

()

Source from the content-addressed store, hash-verified

1855 * Retrieves the previous date part in the list of parts.
1856 */
1857 previousPart(): Option.Option<DatePart> {
1858 const currentPartIndex = Arr.findFirstIndex(this.parts, (part) => part === this)
1859 if (Option.isSome(currentPartIndex)) {
1860 return Arr.findLast(this.parts.slice(0, currentPartIndex.value), (part) => !part.isToken())
1861 }
1862 return Option.none()
1863 }
1864
1865 toString() {
1866 return String(this.date)

Callers

nothing calls this directly

Calls 1

isTokenMethod · 0.80

Tested by

no test coverage detected