mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Bump to v4.10.0.
This commit is contained in:
13
trimEnd.js
13
trimEnd.js
@@ -1,4 +1,4 @@
|
||||
define(['./_charsEndIndex', './_stringToArray', './toString'], function(charsEndIndex, stringToArray, toString) {
|
||||
define(['./_castSlice', './_charsEndIndex', './_stringToArray', './toString'], function(castSlice, charsEndIndex, stringToArray, toString) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -33,14 +33,13 @@ define(['./_charsEndIndex', './_stringToArray', './toString'], function(charsEnd
|
||||
if (guard || chars === undefined) {
|
||||
return string.replace(reTrimEnd, '');
|
||||
}
|
||||
chars = (chars + '');
|
||||
if (!chars) {
|
||||
if (!(chars += '')) {
|
||||
return string;
|
||||
}
|
||||
var strSymbols = stringToArray(string);
|
||||
return strSymbols
|
||||
.slice(0, charsEndIndex(strSymbols, stringToArray(chars)) + 1)
|
||||
.join('');
|
||||
var strSymbols = stringToArray(string),
|
||||
end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
|
||||
|
||||
return castSlice(strSymbols, 0, end).join('');
|
||||
}
|
||||
|
||||
return trimEnd;
|
||||
|
||||
Reference in New Issue
Block a user