code: function generatorToPromise(fn) {
      if (typeof fn !== 'function') {
          throw Error('fn is not a function');
      }
      if (!isGenerator(fn)) {
          // assume it's Promise-based
          return fn;
      }
      return co.wrap(fn);
  }
docs: Convert GeneratorFunction fn to Promise
  
  @param {Function} fn
  @returns {Promise}