Version 1
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / internal / trimmedRightIndex.js
diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/internal/trimmedRightIndex.js b/node_modules/grunt-legacy-log/node_modules/lodash/internal/trimmedRightIndex.js
new file mode 100644 (file)
index 0000000..71b9e38
--- /dev/null
@@ -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;