You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
442 B
19 lines
442 B
import trimmedEndIndex from './_trimmedEndIndex.js'; |
|
|
|
/** 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; |
|
} |
|
|
|
export default baseTrim;
|
|
|