mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Bump to v3.10.0.
This commit is contained in:
22
internal/createDefaults.js
Normal file
22
internal/createDefaults.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import restParam from '../function/restParam';
|
||||
|
||||
/**
|
||||
* Creates a `_.defaults` or `_.defaultsDeep` function.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} assigner The function to assign values.
|
||||
* @param {Function} customizer The function to customize assigned values.
|
||||
* @returns {Function} Returns the new defaults function.
|
||||
*/
|
||||
function createDefaults(assigner, customizer) {
|
||||
return restParam(function(args) {
|
||||
var object = args[0];
|
||||
if (object == null) {
|
||||
return object;
|
||||
}
|
||||
args.push(customizer);
|
||||
return assigner.apply(undefined, args);
|
||||
});
|
||||
}
|
||||
|
||||
export default createDefaults;
|
||||
Reference in New Issue
Block a user