UNPKG

598 BJavaScriptView Raw
1'use strict';
2
3// Load modules
4
5
6// Declare internals
7
8const internals = {};
9
10
11exports.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
32exports.applyOptions = function (parent, child) {
33
34 Object.keys(child).forEach((key) => {
35
36 parent[key] = child[key];
37 });
38};