Version 1
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / internal / pickByArray.js
diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/internal/pickByArray.js b/node_modules/grunt-legacy-log/node_modules/lodash/internal/pickByArray.js
new file mode 100644 (file)
index 0000000..0999d90
--- /dev/null
@@ -0,0 +1,28 @@
+var toObject = require('./toObject');
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+function pickByArray(object, props) {
+  object = toObject(object);
+
+  var index = -1,
+      length = props.length,
+      result = {};
+
+  while (++index < length) {
+    var key = props[index];
+    if (key in object) {
+      result[key] = object[key];
+    }
+  }
+  return result;
+}
+
+module.exports = pickByArray;