Version 1
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / _baseSum.js
diff --git a/node_modules/grunt-legacy-log-utils/node_modules/lodash/_baseSum.js b/node_modules/grunt-legacy-log-utils/node_modules/lodash/_baseSum.js
new file mode 100644 (file)
index 0000000..348b5e8
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * The base implementation of `_.sum` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the sum.
+ */
+function baseSum(array, iteratee) {
+  var result,
+      index = -1,
+      length = array.length;
+
+  while (++index < length) {
+    var current = iteratee(array[index]);
+    if (current !== undefined) {
+      result = result === undefined ? current : (result + current);
+    }
+  }
+  return result;
+}
+
+module.exports = baseSum;