Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / internal / copyObjectWith.js
diff --git a/node_modules/uncss/node_modules/lodash/internal/copyObjectWith.js b/node_modules/uncss/node_modules/lodash/internal/copyObjectWith.js
new file mode 100644 (file)
index 0000000..7c71e87
--- /dev/null
@@ -0,0 +1,29 @@
+var assignValue = require('./assignValue');
+
+/**
+ * This function is like `copyObject` except that it accepts a function to
+ * customize copied values.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @param {Function} [customizer] The function to customize copied values.
+ * @returns {Object} Returns `object`.
+ */
+function copyObjectWith(source, props, object, customizer) {
+  object || (object = {});
+
+  var index = -1,
+      length = props.length;
+
+  while (++index < length) {
+    var key = props[index],
+        newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];
+
+    assignValue(object, key, newValue);
+  }
+  return object;
+}
+
+module.exports = copyObjectWith;