mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Bump to v3.0.0.
This commit is contained in:
19
internal/trimmedLeftIndex.js
Normal file
19
internal/trimmedLeftIndex.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import isSpace from './isSpace';
|
||||
|
||||
/**
|
||||
* Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
|
||||
* character of `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to inspect.
|
||||
* @returns {number} Returns the index of the first non-whitespace character.
|
||||
*/
|
||||
function trimmedLeftIndex(string) {
|
||||
var index = -1,
|
||||
length = string.length;
|
||||
|
||||
while (++index < length && isSpace(string.charCodeAt(index))) {}
|
||||
return index;
|
||||
}
|
||||
|
||||
export default trimmedLeftIndex;
|
||||
Reference in New Issue
Block a user