3912c4c85e005a5aff591ff42ce052cd9bebec73
[yaffs-website] / node_modules / uncss / node_modules / lodash / forOwnRight.js
1 var baseForOwnRight = require('./internal/baseForOwnRight'),
2     toFunction = require('./internal/toFunction');
3
4 /**
5  * This method is like `_.forOwn` except that it iterates over properties of
6  * `object` in the opposite order.
7  *
8  * @static
9  * @memberOf _
10  * @category Object
11  * @param {Object} object The object to iterate over.
12  * @param {Function} [iteratee=_.identity] The function invoked per iteration.
13  * @returns {Object} Returns `object`.
14  * @example
15  *
16  * function Foo() {
17  *   this.a = 1;
18  *   this.b = 2;
19  * }
20  *
21  * Foo.prototype.c = 3;
22  *
23  * _.forOwnRight(new Foo, function(value, key) {
24  *   console.log(key);
25  * });
26  * // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'
27  */
28 function forOwnRight(object, iteratee) {
29   return object && baseForOwnRight(object, toFunction(iteratee));
30 }
31
32 module.exports = forOwnRight;