rivo
Version:
🤖 The ultimate library you need for composable type-level programming in TypeScript, powered by HKT.
9 lines (6 loc) • 310 B
TypeScript
import type { Args, Fn } from "../HKT";
export type StartsWith<Prefix extends string, S extends string> =
S extends `${Prefix}${string}` ? true : false;
export default interface StartsWithFn extends Fn<[string, string], boolean> {
def: ([prefix, s]: Args<this>) => StartsWith<typeof prefix, typeof s>;
}