Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / trimmedRightIndex.js
1 var isSpace = require('./isSpace');
2
3 /**
4  * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
5  * character of `string`.
6  *
7  * @private
8  * @param {string} string The string to inspect.
9  * @returns {number} Returns the index of the last non-whitespace character.
10  */
11 function trimmedRightIndex(string) {
12   var index = string.length;
13
14   while (index-- && isSpace(string.charCodeAt(index))) {}
15   return index;
16 }
17
18 module.exports = trimmedRightIndex;