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

@@ -13,7 +13,6 @@ const methodName = ''.trimRight ? 'trimRight': 'trimEnd'
* @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 trim, trimStart
* @example
@@ -24,9 +23,9 @@ const methodName = ''.trimRight ? 'trimRight': 'trimEnd'
* trimEnd('-_-abc-_-', '_-')
* // => '-_-abc'
*/
function trimEnd(string, chars, guard) {
function trimEnd(string, chars) {
string = toString(string)
if (string && (guard || chars === undefined)) {
if (string && chars === undefined) {
return string[methodName]()
}
if (!string || !(chars = baseToString(chars))) {