index.js
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);
}
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);
}
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 ) ; }
Convert GeneratorFunction fn to Promise

@param {Function} fn
@returns {Promise}
Convert GeneratorFunction fn to Promise