UNPKG

rivo

Version:

🤖 The ultimate library you need for composable type-level programming in TypeScript, powered by HKT.

9 lines (6 loc) • 303 B
import type { Args, Fn } from "../HKT"; export type TrimLeft<C extends string, S extends string> = S extends `${C}${infer R}` ? TrimLeft<C, TrimLeft<C, R>> : S; export default interface TrimLeftFn extends Fn<[string, string], string> { def: ([c, s]: Args<this>) => TrimLeft<typeof c, typeof s>; }