Urara-Blog/node_modules/.pnpm-store/v3/files/8c/21c520d982a55babfc499e34c690d96e99363a92a700bbed13332415eea7a3d57b6f076db2b71816e7733022bc37101a8d4f30560deeab9af260edc976828e
2022-08-14 01:14:53 +08:00

19 lines
444 B
Text

var trimmedEndIndex = require('./_trimmedEndIndex');
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;
/**
* The base implementation of `_.trim`.
*
* @private
* @param {string} string The string to trim.
* @returns {string} Returns the trimmed string.
*/
function baseTrim(string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string;
}
module.exports = baseTrim;