b9a83c3b529f6f384c334e492bd3b23b708b0a54
[platform/framework/web/crosswalk-tizen.git] /
1 var bindCallback = require('./bindCallback');
2
3 /**
4  * Creates a function for `_.forOwn` or `_.forOwnRight`.
5  *
6  * @private
7  * @param {Function} objectFunc The function to iterate over an object.
8  * @returns {Function} Returns the new each function.
9  */
10 function createForOwn(objectFunc) {
11   return function(object, iteratee, thisArg) {
12     if (typeof iteratee != 'function' || thisArg !== undefined) {
13       iteratee = bindCallback(iteratee, thisArg, 3);
14     }
15     return objectFunc(object, iteratee);
16   };
17 }
18
19 module.exports = createForOwn;