frontend/.pnpm-store/v3/files/19/b7bffff9057082426089013776d1545ddfd69f83045c61b479d3536ca6aa213564eb06b03b59901af0dddbfe777c6c8587bbdd2285076df83d7c7e9d9a2f8d

9 lines
331 B
Plaintext

/**
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.
*/
export type Split<S extends string, D extends string> =
string extends S ? string[] :
S extends '' ? [] :
S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] :
[S];