Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/froebel/mod.ts>prefix

A strictly typed utility library.
Go to Latest
variable prefix
import { prefix } from "https://deno.land/x/froebel@v0.21.3/mod.ts";

Returns str prefixed with prefix. Optionally, allows prefxing in camel case, i.e. prefix('foo', 'bar', 'camel') => 'fooBar', or snake case, i.e. prefix('foo', 'bar', 'snake') => 'foo_bar'.

The result is strictly typed, so prefix('foo', 'bar') will return the type 'foobar', not just a generic string.

type

<T0 extends string, T1 extends string, C extends StringCase | void = void>(
prefix: T0,
str: T1,
caseMod?: C,
) => Prefix<T1, T0, C>