mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-27 06:25:13 +08:00
13 lines
277 B
JavaScript
13 lines
277 B
JavaScript
|
|
var clone = require('clone');
|
||
|
|
|
||
|
|
module.exports = function(options, defaults) {
|
||
|
|
options = options || {};
|
||
|
|
|
||
|
|
Object.keys(defaults).forEach(function(key) {
|
||
|
|
if (typeof options[key] === 'undefined') {
|
||
|
|
options[key] = clone(defaults[key]);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
return options;
|
||
|
|
};
|