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
I just installed magic-regexp via
yarn add magic-regexpand tried the first example from https://regexp.dev/getting-started/examplesTypescript 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