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

x/froebel/mod.ts>snake

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

Transforms a variable name to snake case.

Note: The rules for transforming anything to snake case are somewhat vague. So use this only for very simple names where the resulting value is absolutely unambiguous. For more examples of how names are transformed, have a look at the test cases.

Examples

Example 1

snake('fooBar') // 'foo_bar'

type

<T extends string>(str: T) => SnakeCase<T>