Skip to content

Commit

Permalink
add snakeCase example with digit (lodash#3993)
Browse files Browse the repository at this point in the history
add `snakeCase` example with digit
  • Loading branch information
abdullahtariq1171 authored and jdalton committed Oct 8, 2018
1 parent 6018350 commit 715aae6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions snakeCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
Expand Down

0 comments on commit 715aae6

Please sign in to comment.