Skip to content

parseAsTuple #1022

@franky47

Description

@franky47

Discussed in #1019

Please see the discussion there for guidance if you want to pick this issue for a PR. 🙏

Originally posted by tacomanator June 20, 2025
There have been a few situations where this would be useful, so I wanted to suggest it.

For example, a date range parser could be implemented as:

parseAsTuple([parseAsIsoDate, parseAsIsoDate])

Advantages over parseAsArrayOf(parseAsDate):

  1. Ensures both dates are present.
  2. Resulting type of [string, string] instead of string[] prevents certain type errors.
  3. Elements could have different types (not relevant in this example).

Just an example there are obviously many others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestparsers/built-inRelated to built-in parsers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions