lodash.bindall
Advanced tools
Comparing version 4.0.0 to 4.1.0
28
index.js
/** | ||
* lodash 4.0.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.1.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -9,4 +9,3 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
*/ | ||
var arrayEach = require('lodash._arrayeach'), | ||
baseFlatten = require('lodash._baseflatten'), | ||
var baseFlatten = require('lodash._baseflatten'), | ||
bind = require('lodash.bind'), | ||
@@ -16,2 +15,23 @@ rest = require('lodash.rest'); | ||
/** | ||
* A specialized version of `_.forEach` for arrays without support for | ||
* iteratee shorthands. | ||
* | ||
* @private | ||
* @param {Array} array The array to iterate over. | ||
* @param {Function} iteratee The function invoked per iteration. | ||
* @returns {Array} Returns `array`. | ||
*/ | ||
function arrayEach(array, iteratee) { | ||
var index = -1, | ||
length = array.length; | ||
while (++index < length) { | ||
if (iteratee(array[index], index, array) === false) { | ||
break; | ||
} | ||
} | ||
return array; | ||
} | ||
/** | ||
* Binds methods of an object to the object itself, overwriting the existing | ||
@@ -43,3 +63,3 @@ * method. | ||
var bindAll = rest(function(object, methodNames) { | ||
arrayEach(baseFlatten(methodNames), function(key) { | ||
arrayEach(baseFlatten(methodNames, 1), function(key) { | ||
object[key] = bind(object[key], object); | ||
@@ -46,0 +66,0 @@ }); |
{ | ||
"name": "lodash.bindall", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "The lodash method `_.bindAll` exported as a module.", | ||
@@ -8,3 +8,3 @@ "homepage": "https://lodash.com/", | ||
"license": "MIT", | ||
"keywords": "lodash, lodash-modularized, stdlib, util, bindall", | ||
"keywords": "lodash-modularized, bindall", | ||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
@@ -19,3 +19,2 @@ "contributors": [ | ||
"dependencies": { | ||
"lodash._arrayeach": "^3.0.0", | ||
"lodash._baseflatten": "^4.0.0", | ||
@@ -22,0 +21,0 @@ "lodash.bind": "^4.0.0", |
@@ -1,2 +0,2 @@ | ||
# lodash.bindall v4.0.0 | ||
# lodash.bindall v4.1.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.bindAll` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#bindAll) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.bindall) for more details. | ||
See the [documentation](https://lodash.com/docs#bindAll) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.bindall) for more details. |
Sorry, the diff of this file is not supported yet
4514
3
63
- Removedlodash._arrayeach@^3.0.0
- Removedlodash._arrayeach@3.0.0(transitive)