Skip to content

Add utils for PlainDate ranges, generators and sequences #74

@bjuppa

Description

@bjuppa

If we start with a generator, we can use that to create some nifty range- and sequence-related functions:

  • plainDateGenerator(next: (x: PlainDate) => PlainDate)(first: PlainDate): Iterable<PlainDate>
  • plainDateRange(days: number)(first: PlainDate): PlainDate[] (days may be negative!)
  • plainDatesBetween(first: PlainDate)(last: PlainDate): PlainDate[]
  • firstPlainDate(predicate: (x: PainDate) => boolean))(sequence: Iterable<PlainDate>): PlainDate | undefined

See https://github.com/tc39/proposal-iterator-helpers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions