Remove guard params.

This commit is contained in:
John-David Dalton
2017-03-05 02:37:18 -08:00
parent 89829331f0
commit bda6d56c60
14 changed files with 22 additions and 41 deletions

View File

@@ -10,7 +10,6 @@ import unicodeWords from './.internal/unicodeWords.js'
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
* @returns {Array} Returns the words of `string`.
* @example
*
@@ -20,10 +19,8 @@ import unicodeWords from './.internal/unicodeWords.js'
* words('fred, barney, & pebbles', /[^, ]+/g)
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
function words(string, pattern) {
string = toString(string)
pattern = guard ? undefined : pattern
if (pattern === undefined) {
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string)
}