UNPKG

rivo

Version:

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

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