UNPKG

@zodash/snake-case

Version:

Convert (camelCase) string to snakeCase.

15 lines (14 loc) 434 B
/** * Converts a string value into [snake case](https://en.wikipedia.org/wiki/Snake_case). * @param value The string to convert. * @returns The snake-cased string. * @example ```ts * snakeCase('fooBarBaz') * // => 'foo_bar_baz' * * snakeCase(['foo', 'bar', 'baz']) * // => 'foo_bar_baz' * ``` */ export declare function snakeCase(value: string | string[]): string; export declare function compose(words: string[]): string;