Open shaKY-iota opened 2 years ago
https://github.com/type-challenges/type-challenges/issues/5519#issue-1090825397
type LengthOfString<S extends string, Count extends unknown[] = []> = S extends `${string}${infer Rest}` ? LengthOfString<Rest, [...Count, unknown]> : Count["length"]