Version 1
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / internal / pickByCallback.js
diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/internal/pickByCallback.js b/node_modules/grunt-legacy-log/node_modules/lodash/internal/pickByCallback.js
new file mode 100644 (file)
index 0000000..79d3cdc
--- /dev/null
@@ -0,0 +1,22 @@
+var baseForIn = require('./baseForIn');
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+function pickByCallback(object, predicate) {
+  var result = {};
+  baseForIn(object, function(value, key, object) {
+    if (predicate(value, key, object)) {
+      result[key] = value;
+    }
+  });
+  return result;
+}
+
+module.exports = pickByCallback;