source: trip-planner-front/node_modules/type-fest/ts41/utilities.d.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 331 bytes
Line 
1/**
2Recursively 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*/
4export 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];
Note: See TracBrowser for help on using the repository browser.