lodash._createassigner
Advanced tools
Comparing version 3.0.1 to 3.1.0
41
index.js
/** | ||
* lodash 3.0.1 (Custom Build) <https://lodash.com/> | ||
* lodash 3.1.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
@@ -10,3 +10,4 @@ * Available under MIT license <https://lodash.com/license> | ||
var bindCallback = require('lodash._bindcallback'), | ||
isIterateeCall = require('lodash._isiterateecall'); | ||
isIterateeCall = require('lodash._isiterateecall'), | ||
restParam = require('lodash.restparam'); | ||
@@ -17,2 +18,4 @@ /** | ||
* | ||
* **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. | ||
* | ||
* @private | ||
@@ -23,28 +26,22 @@ * @param {Function} assigner The function to assign values. | ||
function createAssigner(assigner) { | ||
return function() { | ||
var args = arguments, | ||
length = args.length, | ||
object = args[0]; | ||
return restParam(function(object, sources) { | ||
var index = -1, | ||
length = object == null ? 0 : sources.length, | ||
customizer = length > 2 && sources[length - 2], | ||
guard = length > 2 && sources[2], | ||
thisArg = length > 1 && sources[length - 1]; | ||
if (length < 2 || object == null) { | ||
return object; | ||
} | ||
var customizer = args[length - 2], | ||
thisArg = args[length - 1], | ||
guard = args[3]; | ||
if (length > 3 && typeof customizer == 'function') { | ||
if (typeof customizer == 'function') { | ||
customizer = bindCallback(customizer, thisArg, 5); | ||
length -= 2; | ||
} else { | ||
customizer = (length > 2 && typeof thisArg == 'function') ? thisArg : null; | ||
customizer = typeof thisArg == 'function' ? thisArg : null; | ||
length -= (customizer ? 1 : 0); | ||
} | ||
if (guard && isIterateeCall(args[1], args[2], guard)) { | ||
customizer = length == 3 ? null : customizer; | ||
length = 2; | ||
if (guard && isIterateeCall(sources[0], sources[1], guard)) { | ||
customizer = length < 3 ? null : customizer; | ||
length = 1; | ||
} | ||
var index = 0; | ||
while (++index < length) { | ||
var source = args[index]; | ||
var source = sources[index]; | ||
if (source) { | ||
@@ -55,5 +52,5 @@ assigner(object, source, customizer); | ||
return object; | ||
}; | ||
}); | ||
} | ||
module.exports = createAssigner; |
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, | ||
Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, | ||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> | ||
@@ -4,0 +4,0 @@ |
{ | ||
"name": "lodash._createassigner", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "The modern build of lodash’s internal `createAssigner` as a module.", | ||
@@ -20,4 +20,5 @@ "homepage": "https://lodash.com/", | ||
"lodash._bindcallback": "^3.0.0", | ||
"lodash._isiterateecall": "^3.0.0" | ||
"lodash._isiterateecall": "^3.0.0", | ||
"lodash.restparam": "^3.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash._createassigner v3.0.1 | ||
# lodash._createassigner v3.1.0 | ||
@@ -20,2 +20,2 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createAssigner` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._createassigner) for more details. | ||
See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._createassigner) for more details. |
4586
3
49
+ Addedlodash.restparam@^3.0.0
+ Addedlodash.restparam@3.6.1(transitive)