lodash.bind
Advanced tools
Comparing version 3.0.0 to 3.1.0
22
index.js
/** | ||
* lodash 3.0.0 (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.7.0 <http://underscorejs.org/LICENSE> | ||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
*/ | ||
var baseSlice = require('lodash._baseslice'), | ||
createWrapper = require('lodash._createwrapper'), | ||
replaceHolders = require('lodash._replaceholders'); | ||
var createWrapper = require('lodash._createwrapper'), | ||
replaceHolders = require('lodash._replaceholders'), | ||
restParam = require('lodash.restparam'); | ||
@@ -33,3 +33,3 @@ /** Used to compose bitmasks for wrapper metadata. */ | ||
* @param {*} thisArg The `this` binding of `func`. | ||
* @param {...*} [args] The arguments to be partially applied. | ||
* @param {...*} [partials] The arguments to be partially applied. | ||
* @returns {Function} Returns the new bound function. | ||
@@ -53,12 +53,10 @@ * @example | ||
*/ | ||
function bind(func, thisArg) { | ||
var bind = restParam(function(func, thisArg, partials) { | ||
var bitmask = BIND_FLAG; | ||
if (arguments.length > 2) { | ||
var partials = baseSlice(arguments, 2), | ||
holders = replaceHolders(partials, bind.placeholder); | ||
if (partials.length) { | ||
var holders = replaceHolders(partials, bind.placeholder); | ||
bitmask |= PARTIAL_FLAG; | ||
} | ||
return createWrapper(func, bitmask, thisArg, partials, holders); | ||
} | ||
}); | ||
@@ -65,0 +63,0 @@ // Assign default placeholders. |
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.bind", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "The modern build of lodash’s `_.bind` as a module.", | ||
@@ -20,6 +20,6 @@ "homepage": "https://lodash.com/", | ||
"dependencies": { | ||
"lodash._baseslice": "^3.0.0", | ||
"lodash._createwrapper": "^3.0.0", | ||
"lodash._replaceholders": "^3.0.0" | ||
"lodash._replaceholders": "^3.0.0", | ||
"lodash.restparam": "^3.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.bind v3.0.0 | ||
# lodash.bind v3.1.0 | ||
@@ -20,2 +20,2 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.bind` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
See the [documentation](https://lodash.com/docs#bind) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.bind) for more details. | ||
See the [documentation](https://lodash.com/docs#bind) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.bind) 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
4891
60
+ Addedlodash.restparam@^3.0.0
+ Addedlodash.restparam@3.6.1(transitive)
- Removedlodash._baseslice@^3.0.0
- Removedlodash._baseslice@3.0.3(transitive)