source:
trip-planner-front/node_modules/defaults/index.js
Last change on this file was 6a3a178, checked in by , 3 years ago | |
---|---|
|
|
File size: 277 bytes |
Line | |
---|---|
1 | var clone = require('clone'); |
2 | |
3 | module.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.