$ Character gets escaped twice
Rigo-m opened this issue Β· comments
Matteo Rigoni commented
π The bug
exactly('$')
gets compiled to \\$
, it should be just \$
π οΈ To reproduce
https://stackblitz.com/edit/github-rujd5h?file=package-lock.json,index.mjs
π Expected behaviour
exactly('$')
should compile to \$
βΉοΈ Additional context
No response
Daniel Roe commented
Ah. The issue here is that at.lineStart
is a function:
- const DOLLAR_RE = createRegExp(exactly('$').at.lineStart);
+ const DOLLAR_RE = createRegExp(exactly('$').at.lineStart());
Daniel Roe commented
You should get a type error something like:
Argument of type '() => Input<"^\\$", never, []>' is not assignable to parameter of type 'string | Input<string, never, []>'.