mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Cleanup fix for modularize underscore and _.mixin and add tests for correct indicatorObject use in underscore builds.
Former-commit-id: 7700fb4df90cdc3eca47af037677d71a70908616
This commit is contained in:
25
dist/lodash.js
vendored
25
dist/lodash.js
vendored
@@ -1650,7 +1650,7 @@
|
||||
*/
|
||||
function findLastKey(object, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forOwnRight(object, function(value, key, object) {
|
||||
if (callback(value, key, object)) {
|
||||
result = key;
|
||||
@@ -1727,17 +1727,16 @@
|
||||
* // => logs 'name' and 'bark' assuming `_.forIn ` logs 'bark' and 'name'
|
||||
*/
|
||||
function forInRight(object, callback, thisArg) {
|
||||
var index = -1,
|
||||
pairs = [];
|
||||
var pairs = [];
|
||||
|
||||
forIn(object, function(value, key) {
|
||||
pairs.push(value, key);
|
||||
pairs.push(key, value);
|
||||
});
|
||||
|
||||
var length = pairs.length;
|
||||
callback = baseCreateCallback(callback, thisArg, 3);
|
||||
while (++index < length) {
|
||||
if (callback(pairs[index], pairs[++index], object) === false) {
|
||||
while (length--) {
|
||||
if (callback(pairs[length--], pairs[length], object) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2868,7 +2867,7 @@
|
||||
*/
|
||||
function findLast(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
forEachRight(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result = value;
|
||||
@@ -2945,7 +2944,7 @@
|
||||
callback = baseCreateCallback(callback, thisArg, 3);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
index = props ? props[--length] : --length;
|
||||
callback(iterable[index], index, collection);
|
||||
return callback(iterable[index], index, collection);
|
||||
});
|
||||
return collection;
|
||||
}
|
||||
@@ -3835,13 +3834,11 @@
|
||||
* // => 2
|
||||
*/
|
||||
function findLastIndex(array, callback, thisArg) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0;
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg);
|
||||
var length = array ? array.length : 0;
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
while (length--) {
|
||||
if (callback(array[index], index, array)) {
|
||||
return index;
|
||||
if (callback(array[length], length, array)) {
|
||||
return length;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user