'use strict';

var _trimmedEndIndex = require('./_trimmedEndIndex.js');

var trimmedEndIndex = _trimmedEndIndex._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;
}

var _baseTrim = baseTrim;

exports._baseTrim = _baseTrim;
//# sourceMappingURL=_baseTrim.js.map
