import { f as IsString, g as IsEmptyString } from './chunks/DZEfmVOc.js'; import './BooleanAnd.js'; import './BooleanOr.js'; import './MaybeReadonly.js'; /** * Extract litteral types of strings separated by a delimiter. * * @template T String to extract litteral types from. * @template S Delimiter to split string with. * @template R The list of tokens extracted so far. (Used internally) * @returns Litteral types of strings separated by a delimiter. * @example StringSplit<'Hello,World'> // ['Hello', 'World'] */ type StringSplit = IsString extends true ? string[] : IsEmptyString extends true ? [] : T extends `${infer A extends string}${S}${infer B extends string}` ? IsEmptyString extends true ? StringSplit : [...R, A, ...StringSplit] : [...R, T]; export type { StringSplit };