This Gist was automatically created by Carbide, a free online programming environment.
This Gist was automatically created by Carbide, a free online programming environment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type WhiteSpace = ' ' | '\t' | '\n' | '\r' | '\f' | |
type Trim<S extends string> = | |
S extends `${WhiteSpace}${infer T}` ? Trim<T> | |
: S extends `${infer T}${WhiteSpace}` ? Trim<T> | |
: S | |
type SqlParamsUnion<T extends string, P extends string = '@'> = | |
T extends `${any}${P}${infer P}${WhiteSpace}${infer R}` | |
? Trim<P> | SqlParamsUnion<R> |