We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00b1dae commit 736c4b9Copy full SHA for 736c4b9
src/core/types/escape.ts
@@ -19,8 +19,11 @@ export type Escape<
19
export type EscapeChar<T extends string> = Escape<T, '\\' | '^' | '-' | ']'>
20
export type StripEscapes<T extends string> = T extends `${infer A}\\${infer B}` ? `${A}${B}` : T
21
22
+// prettier-ignore
23
+type ExactEscapeChar = '.' | '*' | '+' | '?' | '^' | '$' | '{' | '}' | '(' | ')' | '|' | '[' | ']' | '/'
24
+
25
export type GetValue<T extends InputSource> = T extends string
- ? EscapeChar<T>
26
+ ? Escape<T, ExactEscapeChar>
27
: T extends Input<infer R>
28
? R
29
: never
0 commit comments