2 * @filedescription Merge Strategy
7 //-----------------------------------------------------------------------------
9 //-----------------------------------------------------------------------------
12 * Container class for several different merge strategies.
17 * Merges two keys by overwriting the first with the second.
18 * @param {*} value1 The value from the first object key.
19 * @param {*} value2 The value from the second object key.
20 * @returns {*} The second value.
22 static overwrite(value1, value2) {
27 * Merges two keys by replacing the first with the second only if the
29 * @param {*} value1 The value from the first object key.
30 * @param {*} value2 The value from the second object key.
31 * @returns {*} The second value if it is defined.
33 static replace(value1, value2) {
34 if (typeof value2 !== "undefined") {
42 * Merges two properties by assigning properties from the second to the first.
43 * @param {*} value1 The value from the first object key.
44 * @param {*} value2 The value from the second object key.
45 * @returns {*} A new object containing properties from both value1 and
48 static assign(value1, value2) {
49 return Object.assign({}, value1, value2);
53 exports.MergeStrategy = MergeStrategy;