ohctechv3/.svn/pristine/f0/f092653ffbdbdee10c589e682bc9eac2d91d14cc.svn-base

20 lines
444 B
Plaintext
Raw Normal View History

2024-10-28 15:03:36 +05:30
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;