aboutsummaryrefslogtreecommitdiff
path: root/node_modules/type-fest/ts41/utilities.d.ts
blob: f82e362fb936ddcbdc098b1179332984f8481e92 (plain)
1
2
3
4
5
6
7
8
/**
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];