mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
add snakeCase example with digit (#3993)
add `snakeCase` example with digit
This commit is contained in:
committed by
John-David Dalton
parent
6018350ac1
commit
715aae679d
@@ -19,6 +19,9 @@ import words from './words.js'
|
||||
*
|
||||
* snakeCase('--FOO-BAR--')
|
||||
* // => 'foo_bar'
|
||||
*
|
||||
* snakeCase('foo2bar')
|
||||
* // => 'foo_2_bar'
|
||||
*/
|
||||
const snakeCase = (string) => (
|
||||
words(`${string}`.replace(/['\u2019]/g, '')).reduce((result, word, index) => (
|
||||
|
||||
Reference in New Issue
Block a user