mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Remove guard params.
This commit is contained in:
5
words.js
5
words.js
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user