mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-24 11:29:30 +08:00
added _.findLastKey definitions
This commit is contained in:
@@ -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' },
|
||||
|
||||
Vendored
+28
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user