@tempots/std

SplitLiteral type

Splits a string literal type T by a specified delimiter SplitBy. Returns a tuple containing the split parts of the string.

Signature:

export type SplitLiteralextends string, SplitBy extends string> = FilterTupleextends `${infer A}${SplitBy}${infer B}` ? [...SplitLiteralSplitBy>, ...SplitLiteralSplitBy>] : [T], ''>;

References: FilterTuple, SplitLiteral