We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4bcf3e commit 90ee1faCopy full SHA for 90ee1fa
index.js
@@ -23,7 +23,7 @@ function mixinDeep(target, objects) {
23
*/
24
25
function copy(val, key) {
26
- if (key === '__proto__') {
+ if (!isValidKey(key)) {
27
return;
28
}
29
@@ -46,6 +46,17 @@ function isObject(val) {
46
return isExtendable(val) && !Array.isArray(val);
47
48
49
+/**
50
+ * Returns true if `key` is a valid key to use when extending objects.
51
+ *
52
+ * @param {String} `key`
53
+ * @return {Boolean}
54
+ */
55
+
56
+function isValidKey(key) {
57
+ return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
58
+};
59
60
/**
61
* Expose `mixinDeep`
62
0 commit comments