added _.findLastKey definitions

This commit is contained in:
Brian Zengel
2013-10-20 12:14:47 -04:00
parent 9d58c2ea97
commit fca7df70bc
2 changed files with 32 additions and 0 deletions
+4
View File
@@ -550,6 +550,10 @@ result = <string>_.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
return num % 2 == 0;
});
result = <string>_.findLastKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
return num % 2 == 1;
});
var mergeNames = {
'stooges': [
{ 'name': 'moe' },
+28
View File
@@ -2235,6 +2235,34 @@ declare module _ {
object: any,
whereValue: Dictionary<any>): string;
/**
* This method is like _.findKey except that it iterates over elements of a collection in the opposite order.
* @param object The object to search.
* @param callback The function called per iteration.
* @param thisArg The this binding of callback.
* @return The key of the found element, else undefined.
**/
export function findLastKey(
object: any,
callback: (value: any) => boolean,
thisArg?: any): string;
/**
* @see _.findLastKey
* @param pluckValue _.pluck style callback
**/
export function findLastKey(
object: any,
pluckValue: string): string;
/**
* @see _.findLastKey
* @param whereValue _.where style callback
**/
export function findLastKey(
object: any,
whereValue: Dictionary<any>): string;
/**
* Recursively merges own enumerable properties of the source object(s), that don't resolve
* to undefined into the destination object. Subsequent sources will overwrite property