Bump to v4.17.21

This commit is contained in:
Benjamin Tan
2021-02-20 23:26:06 +08:00
parent f2e7063ee4
commit c6e281b878
14 changed files with 280 additions and 179 deletions

View File

@@ -2,10 +2,8 @@ var baseToString = require('./_baseToString'),
castSlice = require('./_castSlice'),
charsEndIndex = require('./_charsEndIndex'),
stringToArray = require('./_stringToArray'),
toString = require('./toString');
/** Used to match leading and trailing whitespace. */
var reTrimEnd = /\s+$/;
toString = require('./toString'),
trimmedEndIndex = require('./_trimmedEndIndex');
/**
* Removes trailing whitespace or specified characters from `string`.
@@ -29,7 +27,7 @@ var reTrimEnd = /\s+$/;
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimEnd, '');
return string.slice(0, trimmedEndIndex(string) + 1);
}
if (!string || !(chars = baseToString(chars))) {
return string;