Skip to content

Bug: If a capture group is part of an optional parent group it is not marked as optional #7

@Nokel81

Description

@Nokel81

Current:

const regex = TypedRegEx("^\w+(@(?<version>[a-z0-9-_.]+))?$", "gi");
const captures = regex.captures(...); // { version: string } | undefined;

Expected:

const regex = TypedRegEx("^\w+(@(?<version>[a-z0-9-_.]+))?$", "gi");
const captures = regex.captures(...); // { version?: string | undefined } | undefined;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions