function isOnCallback (str) {
  return typeof str === 'string' && /^on(.+)/.test(str)
}

/**
 * Function called recursively on all the object properties
 * If a property is a function we make it promisable
 * @param   { Object } parent - context where the apply method will be triggered
 * @param   { String } prop - property we are trying to get from the parent object
 * @returns { Proxy }
 */
function makePromisable (parent, prop) {
  return new Proxy(prop ? parent[prop] : parent, {
    get: (target, property) => {
      // no function no need for promises in return
      if (isOnCallback(property)) {
        // detect properties like
        // window.onload.then(() => console.log('loaded'))
        return new Promise((resolve) => {
          target[property] = resolve
        })
      } else if (typeof target[property] !== 'function') {
        return target[property]
      } else {
        // make proxy also the nested object properties
        return makePromisable(target, property)
      }
    },
    // this is cool to make promiseable event emitters
    //  and many other native node methods
    apply: (target, thisArg, argumentsList) => {
      return new Promise((resolve, reject) => {
        // guessing the timer functions from the type of arguments passed to the method
        const isTimer = !argumentsList.length || typeof argumentsList[0] === 'number'
        // assuming the callback will be always the second argument
        argumentsList.splice(isTimer ? 0 : 1, 0, resolve)
        Reflect.apply(target, parent, argumentsList)
      })
    }
  })
}

module.exports = exports.default = (object) => makePromisable(object)

@@ -1159,30 +1159,61 @@
  =%3E %7B%0A      
+let 
 return
+Value%0A      const promise =
  new Promise
@@ -1543,16 +1543,30 @@
 %0A       
+ returnValue =
  Reflect
@@ -1608,24 +1608,134 @@
 t)%0A      %7D)%0A
+      // Return the returnValue through valueOf%0A      promise.valueOf = _ =%3E returnValue%0A      return promise%0A
     %7D%0A  %7D)%0A%7D

Return the value of the function call via `valueOf`