function snake
snake(text: string): string

Converts a string to snake_case by replacing spaces and punctuation with underscores. Uses kebab() internally, replacing hyphens with underscores.

Examples

Example 1

snake(null); // "" snake("Hello World"); // "hello_world" snake("User-Profile Page"); // "user_profile_page"

Parameters

text: string

Return Type

string

Usage

import { snake } from ".";