mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
20 lines
442 B
JavaScript
20 lines
442 B
JavaScript
|
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;
|