Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / charsLeftIndex.js
1 /**
2  * Used by `_.trim` and `_.trimLeft` to get the index of the first character
3  * of `string` that is not found in `chars`.
4  *
5  * @private
6  * @param {string} string The string to inspect.
7  * @param {string} chars The characters to find.
8  * @returns {number} Returns the index of the first character not found in `chars`.
9  */
10 function charsLeftIndex(string, chars) {
11   var index = -1,
12       length = string.length;
13
14   while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
15   return index;
16 }
17
18 module.exports = charsLeftIndex;