lodash.defaults
Advanced tools
Comparing version 3.1.1 to 3.1.2
30
index.js
/** | ||
* lodash 3.1.1 (Custom Build) <https://lodash.com/> | ||
* lodash 3.1.2 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
@@ -25,2 +25,21 @@ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
/** | ||
* 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); | ||
}); | ||
} | ||
/** | ||
* Assigns own enumerable properties of source object(s) to the destination | ||
@@ -43,11 +62,4 @@ * object for all destination properties that resolve to `undefined`. Once a | ||
*/ | ||
var defaults = restParam(function(args) { | ||
var object = args[0]; | ||
if (object == null) { | ||
return object; | ||
} | ||
args.push(assignDefaults); | ||
return assign.apply(undefined, args); | ||
}); | ||
var defaults = createDefaults(assign, assignDefaults); | ||
module.exports = defaults; |
{ | ||
"name": "lodash.defaults", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "The modern build of lodash’s `_.defaults` as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash.defaults v3.1.1 | ||
# lodash.defaults v3.1.2 | ||
@@ -20,2 +20,2 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.defaults` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
See the [documentation](https://lodash.com/docs#defaults) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.defaults) for more details. | ||
See the [documentation](https://lodash.com/docs#defaults) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.defaults) for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4875
59