UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

26 lines (25 loc) 588 B
/** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @see camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst * @example * * snakeCase('Foo Bar') * // => 'foo_bar' * * snakeCase('fooBar') * // => 'foo_bar' * * snakeCase('--FOO-BAR--') * // => 'foo_bar' * * snakeCase('foo2bar') * // => 'foo_2_bar' */ declare const snakeCase: (string: any) => string; export default snakeCase;