Merge pull request #24 from jhnns/fix-config-defaults
Use lodash's default() function
This commit is contained in:
commit
dfeddcb4e4
|
@ -44,10 +44,7 @@ module.exports = (cb) ->
|
||||||
# Make the request.
|
# Make the request.
|
||||||
request.config (err, result) ->
|
request.config (err, result) ->
|
||||||
# We do not strictly require config files.
|
# We do not strictly require config files.
|
||||||
config = {} if err or not _.isObject result
|
config = _.defaults result, defaults
|
||||||
|
|
||||||
# Tack on defaults?
|
|
||||||
( config[k] ?= v for k, v of defaults )
|
|
||||||
|
|
||||||
# RegExpify the size label?
|
# RegExpify the size label?
|
||||||
if config.size_label
|
if config.size_label
|
||||||
|
|
Loading…
Reference in New Issue