mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-14 22:10:30 +00:00
added _.forOwn definitions
This commit is contained in:
@@ -570,6 +570,10 @@ _.forInRight(new Dog('Dagny'), function(value, key) {
|
||||
console.log(key);
|
||||
});
|
||||
|
||||
_.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
console.log(key);
|
||||
});
|
||||
|
||||
var mergeNames = {
|
||||
'stooges': [
|
||||
{ 'name': 'moe' },
|
||||
|
||||
Vendored
+14
@@ -2290,6 +2290,20 @@ declare module _ {
|
||||
callback?: ObjectIterator<T, void>,
|
||||
thisArg?: any): Dictionary<T>;
|
||||
|
||||
/**
|
||||
* Iterates over own enumerable properties of an object, executing the callback for each
|
||||
* property. The callback is bound to thisArg and invoked with three arguments; (value, key,
|
||||
* object). Callbacks may exit iteration early by explicitly returning false.
|
||||
* @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 forOwn<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