Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _arrayFilter.js
diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/_arrayFilter.js b/node_modules/grunt-legacy-util/node_modules/lodash/_arrayFilter.js
new file mode 100644 (file)
index 0000000..297083b
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+ * A specialized version of `_.filter` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function arrayFilter(array, predicate) {
+  var index = -1,
+      length = array.length,
+      resIndex = -1,
+      result = [];
+
+  while (++index < length) {
+    var value = array[index];
+    if (predicate(value, index, array)) {
+      result[++resIndex] = value;
+    }
+  }
+  return result;
+}
+
+module.exports = arrayFilter;