Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
334 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | module.exports = function mergeOptions(defaults, options) {
|
---|
| 4 | options = options || Object.create(null);
|
---|
| 5 |
|
---|
| 6 | return [defaults, options].reduce((merged, optObj) => {
|
---|
| 7 | Object.keys(optObj).forEach(key => {
|
---|
| 8 | merged[key] = optObj[key];
|
---|
| 9 | });
|
---|
| 10 |
|
---|
| 11 | return merged;
|
---|
| 12 | }, Object.create(null));
|
---|
| 13 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.