Skip to content

Predefined Input can not be assigned to InputSource when using with TypeScript < 4.7 #62

Description

@tim3trick

I just installed magic-regexp via yarn add magic-regexp and tried the first example from https://regexp.dev/getting-started/examples

Typescript does not like it though: Argument of type 'Input<"\\d", never>' is not assignable to parameter of type 'InputSource<string, never>'.

The code can also be simplified even more:
const regex = createRegExp(oneOrMore(digit));

I have created a codesandbox for showcasing this: https://codesandbox.io/s/gracious-swartz-3sdfcs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions