String.StartsWith?
jasonkuhrt opened this issue · comments
Jason Kuhrt commented
🍩 Feature Request
Is your feature request related to a problem?
Need this type for working with string literals:
export type StartsWith<Prefix extends string, S extends string> =
Prefix extends `${infer head1}${infer tail1}` ?
S extends `${infer head2}${infer tail2}` ?
head1 extends head2 ?
StartsWith<tail1,tail2>
: false
: false
: true
Something that could go into the library here?