Blame view

天文台pc/tianwentai-ui/node_modules/lodash/_baseTrim.js 444 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  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;