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
trim.js
5
trim.js
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user