Version 1
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / internal / trimmedLeftIndex.js
diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/internal/trimmedLeftIndex.js b/node_modules/grunt-legacy-log/node_modules/lodash/internal/trimmedLeftIndex.js
new file mode 100644 (file)
index 0000000..08aeb13
--- /dev/null
@@ -0,0 +1,19 @@
+var isSpace = require('./isSpace');
+
+/**
+ * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the first non-whitespace character.
+ */
+function trimmedLeftIndex(string) {
+  var index = -1,
+      length = string.length;
+
+  while (++index < length && isSpace(string.charCodeAt(index))) {}
+  return index;
+}
+
+module.exports = trimmedLeftIndex;