UNPKG

rivo

Version:

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

11 lines (8 loc) • 403 B
import type { TrimLeft } from "./TrimLeft"; import type { TrimRight } from "./TrimRight"; import type { Args, Fn } from "../HKT"; import type { AssertStr } from "../helpers"; export type Trim<C extends string, S extends string> = AssertStr<TrimLeft<C, TrimRight<C, S>>>; export default interface TrimFn extends Fn<[string, string], string> { def: ([c, s]: Args<this>) => Trim<typeof c, typeof s>; }