mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.forInRight definition
This commit is contained in:
+12
-8
@@ -72,6 +72,14 @@ var keys: IKey[] = [
|
||||
{ 'dir': 'right', 'code': 100 }
|
||||
];
|
||||
|
||||
function Dog(name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
Dog.prototype.bark = function() {
|
||||
console.log('Woof, woof!');
|
||||
};
|
||||
|
||||
var result;
|
||||
|
||||
//Array Method Tests
|
||||
@@ -554,18 +562,14 @@ result = <string>_.findLastKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num)
|
||||
return num % 2 == 1;
|
||||
});
|
||||
|
||||
function Dog(name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
Dog.prototype.bark = function() {
|
||||
console.log('Woof, woof!');
|
||||
};
|
||||
|
||||
_.forIn(new Dog('Dagny'), function(value, key) {
|
||||
console.log(key);
|
||||
});
|
||||
|
||||
_.forInRight(new Dog('Dagny'), function(value, key) {
|
||||
console.log(key);
|
||||
});
|
||||
|
||||
var mergeNames = {
|
||||
'stooges': [
|
||||
{ 'name': 'moe' },
|
||||
|
||||
Vendored
+13
@@ -2277,6 +2277,19 @@ declare module _ {
|
||||
callback?: ObjectIterator<T, void>,
|
||||
thisArg?: any): Dictionary<T>;
|
||||
|
||||
/**
|
||||
* This method is like _.forIn except that it iterates over elements of a collection in the
|
||||
* opposite order.
|
||||
* @param object The object to iterate over.
|
||||
* @param callback The function called per iteration.
|
||||
* @param thisArg The this binding of callback.
|
||||
* @return object
|
||||
**/
|
||||
export function forInRight<T extends {}>(
|
||||
object: Dictionary<T>,
|
||||
callback?: ObjectIterator<T, void>,
|
||||
thisArg?: any): Dictionary<T>;
|
||||
|
||||
|
||||
/**
|
||||
* Recursively merges own enumerable properties of the source object(s), that don't resolve
|
||||
|
||||
Reference in New Issue
Block a user