updeep-remeda/lib/withDefault.js
2017-04-18 17:55:46 -07:00

13 lines
273 B
JavaScript

import update from './update'
import curry from './util/curry'
function withDefault(defaultValue, updates, object) {
if (typeof object === 'undefined') {
return update(updates, defaultValue)
}
return update(updates, object)
}
export default curry(withDefault)