|
@@ -1,4 +1,11 @@
|
|
|
-const defaults = (obj, values) => ({
|
|
|
+/**
|
|
|
+ * Populates an object with default values.
|
|
|
+ *
|
|
|
+ * @param {Object} obj - the object to populate the values on
|
|
|
+ * @param {Object} values - the default values to populate on the target object
|
|
|
+ * @return {Object} a new object with the default values and the object values
|
|
|
+ */
|
|
|
+const defaults = (obj = {}, values = {}) => ({
|
|
|
...values,
|
|
|
...obj
|
|
|
});
|