b7bffff9057082426089013776d1545ddfd69f83045c61b479d3536ca6aa213564eb06b03b59901af0dddbfe777c6c8587bbdd2285076df83d7c7e9d9a2f8d 331 B

12345678
  1. /**
  2. Recursively split a string literal into two parts on the first occurence of the given string, returning an array literal of all the separate parts.
  3. */
  4. export type Split<S extends string, D extends string> =
  5. string extends S ? string[] :
  6. S extends '' ? [] :
  7. S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] :
  8. [S];