storage-upload/api/defaults.js

15 lines
320 B
JavaScript
Raw Normal View History

2017-12-09 21:51:18 +00:00
export default function defaults(options, defaults) {
options = options || {}
Object.keys(defaults).forEach(function(key) {
if (typeof options[key] === 'undefined') {
// No need to do clone since we mostly deal with
// flat objects
options[key] = defaults[key]
}
})
return options
}