1 | 'use strict';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | const internals = {};
|
9 |
|
10 |
|
11 | exports.mergeOptions = function (parent, child, ignore) {
|
12 |
|
13 | ignore = ignore || [];
|
14 | const options = {};
|
15 |
|
16 | Object.keys(parent || {}).forEach((key) => {
|
17 |
|
18 | if (ignore.indexOf(key) === -1) {
|
19 | options[key] = parent[key];
|
20 | }
|
21 | });
|
22 |
|
23 | Object.keys(child || {}).forEach((key) => {
|
24 |
|
25 | options[key] = child[key];
|
26 | });
|
27 |
|
28 | return options;
|
29 | };
|
30 |
|
31 |
|
32 | exports.applyOptions = function (parent, child) {
|
33 |
|
34 | Object.keys(child).forEach((key) => {
|
35 |
|
36 | parent[key] = child[key];
|
37 | });
|
38 | };
|