From 715aae679d71475d82e0153bd6a14083abe9fc19 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah <5623766+abdullahtariq1171@users.noreply.github.com> Date: Mon, 8 Oct 2018 19:58:33 +0500 Subject: [PATCH] add snakeCase example with digit (#3993) add `snakeCase` example with digit --- snakeCase.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snakeCase.js b/snakeCase.js index 794a0e1ff..2599e9f56 100644 --- a/snakeCase.js +++ b/snakeCase.js @@ -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) => (