File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4577,3 +4577,23 @@ interface Date {
45774577 */
45784578 toLocaleTimeString ( locales ?: string | string [ ] , options ?: Intl . DateTimeFormatOptions ) : string ;
45794579}
4580+
4581+ type Split < Source extends string , Separator extends string > = Source extends `${infer Left } ${Separator } ${infer Right } `
4582+ ? [ ...( string extends Left ? string [ ] : [ `${Left } `] ) , ...Split < Right , Separator > ]
4583+ : Source extends ""
4584+ ? Separator extends ""
4585+ ? [ ]
4586+ : [ "" ]
4587+ : string extends Source
4588+ ? string [ ]
4589+ : [ Source ] ;
4590+
4591+ interface String {
4592+ split < Source extends string , Separator extends string > (
4593+ this : Source ,
4594+ separator : Separator ,
4595+ limit ?: undefined ,
4596+ ) : Split < Source , Separator > ;
4597+
4598+ split ( separator : string | RegExp , limit : 0 ) : [ ] ;
4599+ }
You can’t perform that action at this time.
0 commit comments