source: trip-planner-front/node_modules/defaults/index.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 277 bytes
Line 
1var clone = require('clone');
2
3module.exports = function(options, defaults) {
4 options = options || {};
5
6 Object.keys(defaults).forEach(function(key) {
7 if (typeof options[key] === 'undefined') {
8 options[key] = clone(defaults[key]);
9 }
10 });
11
12 return options;
13};
Note: See TracBrowser for help on using the repository browser.