From 4061027995a14c5015d00b34a2b71920a8680b5b Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 12:36:18 -0400 Subject: [PATCH] added _.forOwnRight definitions --- lodash/lodash-tests.ts | 4 ++++ lodash/lodash.d.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 1049e51a5..9ca5eed57 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -574,6 +574,10 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { console.log(key); }); +_.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + console.log(key); +}); + var mergeNames = { 'stooges': [ { 'name': 'moe' }, diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index aca02b02d..ab380a5b8 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2304,6 +2304,19 @@ declare module _ { callback?: ObjectIterator, thisArg?: any): Dictionary; + /** + * This method is like _.forOwn 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 forOwnRight( + object: Dictionary, + callback?: ObjectIterator, + thisArg?: any): Dictionary; + /** * Recursively merges own enumerable properties of the source object(s), that don't resolve