typed-regex icon indicating copy to clipboard operation
typed-regex copied to clipboard

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

Open Nokel81 opened this issue 2 years ago • 0 comments

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;

Nokel81 avatar Mar 29 '22 16:03 Nokel81