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

@@ -12,7 +12,6 @@ import toString from './toString.js'
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
* @returns {string} Returns the trimmed string.
* @see trimEnd, trimStart
* @example
@@ -26,9 +25,9 @@ import toString from './toString.js'
* map([' foo ', ' bar '], trim)
* // => ['foo', 'bar']
*/
function trim(string, chars, guard) {
function trim(string, chars) {
string = toString(string)
if (string && (guard || chars === undefined)) {
if (string && chars === undefined) {
return string.trim()
}
if (!string || !(chars = baseToString(chars))) {