mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Bump to v4.11.2.
This commit is contained in:
8
trim.js
8
trim.js
@@ -1,3 +1,4 @@
|
||||
import baseToString from './_baseToString';
|
||||
import castSlice from './_castSlice';
|
||||
import charsEndIndex from './_charsEndIndex';
|
||||
import charsStartIndex from './_charsStartIndex';
|
||||
@@ -31,13 +32,10 @@ var reTrim = /^\s+|\s+$/g;
|
||||
*/
|
||||
function trim(string, chars, guard) {
|
||||
string = toString(string);
|
||||
if (!string) {
|
||||
return string;
|
||||
}
|
||||
if (guard || chars === undefined) {
|
||||
if (string && (guard || chars === undefined)) {
|
||||
return string.replace(reTrim, '');
|
||||
}
|
||||
if (!(chars += '')) {
|
||||
if (!string || !(chars = baseToString(chars))) {
|
||||
return string;
|
||||
}
|
||||
var strSymbols = stringToArray(string),
|
||||
|
||||
Reference in New Issue
Block a user