import * as H from "../../helpers"; type ConcatSplits = Parts extends [infer First extends string, ...infer Rest extends string[]] ? ConcatSplits]> : Acc; type SplitManySep = Sep extends [ infer FirstSep extends string, ...infer RestSep extends string[] ] ? ConcatSplits, RestSep> : [Str, ...Acc]; /** * Split a string into a tuple. * @param Str - The string to split. * @param Sep - The separator to split on, can be a union of strings of more than one character. * @returns The tuple of each split. if sep is an empty string, returns a tuple of each character. */ export type Split> = Seps extends string[] ? Str extends string ? SplitManySep : [] : []; /** * Split a string into a tuple with each character. * @param Str - The string to split. * @returns The tuple of each character. */ export type StringToTuple = Str extends string ? Str extends `${infer First}${infer Rest}` ? StringToTuple : Acc : []; export {};