diff options
Diffstat (limited to 'tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedRightIndex.js')
-rw-r--r-- | tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedRightIndex.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedRightIndex.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedRightIndex.js new file mode 100644 index 0000000000..71b9e38a62 --- /dev/null +++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedRightIndex.js @@ -0,0 +1,18 @@ +var isSpace = require('./isSpace'); + +/** + * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ +function trimmedRightIndex(string) { + var index = string.length; + + while (index-- && isSpace(string.charCodeAt(index))) {} + return index; +} + +module.exports = trimmedRightIndex; |