Skip to content

Commit bb9bf21

Browse files
committed
Rename variables
1 parent e24dcf5 commit bb9bf21

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/merge.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// Merge two objects, including their prototypes
44
function mergePrototypes(to, from) {
55
const prototypes = [...getPrototypes(to), ...getPrototypes(from)];
6-
const newPrototype = prototypes.reduce(reducePrototype, {});
7-
return Object.assign(Object.setPrototypeOf(to, newPrototype), to, from);
6+
const prototype = prototypes.reduce(shallowMerge, {});
7+
return Object.assign(Object.setPrototypeOf(to, prototype), from);
88
}
99

1010
function getPrototypes(object, prototypes = []) {
@@ -16,8 +16,8 @@ function getPrototypes(object, prototypes = []) {
1616
return prototypes;
1717
}
1818

19-
function reducePrototype(prototype, constructor) {
20-
return Object.defineProperties(prototype, Object.getOwnPropertyDescriptors(constructor));
19+
function shallowMerge(toObject, fromObject) {
20+
return Object.defineProperties(toObject, Object.getOwnPropertyDescriptors(fromObject));
2121
}
2222

2323
module.exports = mergePrototypes;

0 commit comments

Comments
 (0)