add snakeCase example with digit (#3993)

add `snakeCase` example with digit
This commit is contained in:
Muhammad Abdullah
2018-10-08 19:58:33 +05:00
committed by John-David Dalton
parent 6018350ac1
commit 715aae679d

View File

@@ -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) => (