Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / charsRightIndex.js
1 /**
2  * Used by `_.trim` and `_.trimRight` to get the index of the last 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 last character not found in `chars`.
9  */
10 function charsRightIndex(string, chars) {
11   var index = string.length;
12
13   while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
14   return index;
15 }
16
17 module.exports = charsRightIndex;