mixin-deep 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +12 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -23,7 +23,7 @@ function mixinDeep(target, objects) {
|
|
23
23
|
*/
|
24
24
|
|
25
25
|
function copy(val, key) {
|
26
|
-
if (key
|
26
|
+
if (!isValidKey(key)) {
|
27
27
|
return;
|
28
28
|
}
|
29
29
|
|
@@ -46,6 +46,17 @@ function isObject(val) {
|
|
46
46
|
return isExtendable(val) && !Array.isArray(val);
|
47
47
|
}
|
48
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
|
+
|
49
60
|
/**
|
50
61
|
* Expose `mixinDeep`
|
51
62
|
*/
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "mixin-deep",
|
3
3
|
"description": "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.",
|
4
|
-
"version": "1.3.
|
4
|
+
"version": "1.3.2",
|
5
5
|
"homepage": "https://github.com/jonschlinkert/mixin-deep",
|
6
6
|
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
7
7
|
"repository": "jonschlinkert/mixin-deep",
|