'use strict';

var isPromise = require('./util/isPromise');

function values(object) {
    var result = {};

    return Promise.all(
        Object.keys(object).map(function (key) {
            if (isPromise(object[key])) {
                return object[key].then(function (value) {
                    return (result[key] = value);
                });
            }

            result[key] = object[key];
        })
    )
    .then(function () { return result; });
}

/*
 * Resolve the values of an object, whether they are promises or values, fulfilled.
 */
module.exports = function (fn) {
    if (typeof fn === 'function') {
        return function (object) {
            return values(object)
            .then(fn);
        };
    }

    // fn is an object
    return values(fn);
};

@@ -125,25 +125,16 @@
 ise.all(
-%0A        
 Object.k
@@ -162,28 +162,24 @@
 ion (key) %7B%0A
-    
         if (
@@ -212,28 +212,24 @@
             
-    
 return objec
@@ -271,28 +271,24 @@
             
-    
 return (resu
@@ -305,20 +305,16 @@
 value);%0A
-    
         
@@ -329,20 +329,16 @@
         
-    
 %7D%0A%0A     
@@ -340,20 +340,24 @@
         
-    
+return (
 result%5Bk
@@ -377,25 +377,17 @@
 key%5D
+)
 ;%0A
-    
     %7D)
-%0A    
 )%0A  

Remove unnecessary indentation