00119
ReplaceAll
type ReplaceAll<S extends string, From extends string, To extends string, U extends string = '', END extends boolean = false> =
From extends '' ? S :
END extends true ? `${U}${S}` :
S['length'] extends 0 ? U :
S extends `${From}${infer Rest}` ? ReplaceAll<Rest, From, To,`${U}${To}`> :
S extends `${infer First}${infer Rest}` ? ReplaceAll<Rest, From, To,`${U}${First extends From ? From : First}`>: U;