rivo
Version:
🤖 The ultimate library you need for composable type-level programming in TypeScript, powered by HKT.
19 lines (16 loc) • 601 B
TypeScript
import type { Args, Fn } from "../HKT";
import type { AssertStr } from "../helpers";
/**
* Prepend a string (the 1st argument) to another string (the 2nd argument).
*
* Sig: `(prefix: string, s: string) => string`
*/
export type Prepend<Prefix extends string, S extends string> = AssertStr<`${Prefix}${S}`>;
/**
* [Fn] Prepend a string (the 1st argument) to another string (the 2nd argument).
*
* Sig: `(prefix: string, s: string) => string`
*/
export default interface PrependFn extends Fn<[string, string], string> {
def: ([prefix, s]: Args<this>) => Prepend<typeof prefix, typeof s>;
}