type _Split = S extends `${infer H}${P}${infer T}` ? _Split : P extends "" ? Acc : [...Acc, S]; /** * splits a string by pattern `P`. * splits greedily from start to end. * * @undefined_behavior `S` or `P` is a template literal * * @since 0.0.6 * * @example * ```ts * type ub0 = Split<`a${string}b${string}c`>, 'b'> // [`a${string}`, `${string}c`] * type ub1 = Split<`a${string}b${string}c`>, string> // ['a', 'b', 'c'] * ``` */ export type Split = S extends '' ? [S] : _Split; export {}; //# sourceMappingURL=split.d.ts.map