UNPKG

rivo

Version:

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

19 lines (16 loc) • 578 B
import type { Args, Fn } from "../HKT"; import type { AssertStr } from "../helpers"; /** * Append a string (the 1st argument) to another string (the 2nd argument). * * Sig: `(ext: string, s: string) => string` */ export type Append<Ext extends string, S extends string> = AssertStr<`${S}${Ext}`>; /** * [Fn] Append a string (the 1st argument) to another string (the 2nd argument). * * Sig: `(ext: string, s: string) => string` */ export default interface AppendFn extends Fn<[string, string], string> { def: ([ext, s]: Args<this>) => Append<typeof ext, typeof s>; }