node_modules/lodash/trimEnd.js in trusty-cms-4.2.3 vs node_modules/lodash/trimEnd.js in trusty-cms-4.3
- old
+ new
@@ -1,12 +1,14 @@
var baseToString = require('./_baseToString'),
castSlice = require('./_castSlice'),
charsEndIndex = require('./_charsEndIndex'),
stringToArray = require('./_stringToArray'),
- toString = require('./toString'),
- trimmedEndIndex = require('./_trimmedEndIndex');
+ toString = require('./toString');
+/** Used to match leading and trailing whitespace. */
+var reTrimEnd = /\s+$/;
+
/**
* Removes trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
@@ -25,10 +27,10 @@
* // => '-_-abc'
*/
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
- return string.slice(0, trimmedEndIndex(string) + 1);
+ return string.replace(reTrimEnd, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),