benchmark/co/index.js
function toPromise( obj ) {
    if( !obj ) {
        return obj;
    }
    if( isPromise( obj ) ) {
        return obj;
    }
    if( isGeneratorFunction( obj ) || isGenerator( obj ) ) {
        return co.call( this, obj );
    }
    if( 'function' == typeof obj ) {
        return thunkToPromise.call( this, obj );
    }
    if( Array.isArray( obj ) ) {
        return arrayToPromise.call( this, obj );
    }
    if( isObject( obj ) ) {
        return objectToPromise.call( this, obj );
    }
    return obj;
}
function toPromise( obj ) {
    if( !obj ) {
        return obj;
    }
    if( isPromise( obj ) ) {
        return obj;
    }
    if( isGeneratorFunction( obj ) || isGenerator( obj ) ) {
        return co.call( this, obj );
    }
    if( 'function' == typeof obj ) {
        return thunkToPromise.call( this, obj );
    }
    if( Array.isArray( obj ) ) {
        return arrayToPromise.call( this, obj );
    }
    if( isObject( obj ) ) {
        return objectToPromise.call( this, obj );
    }
    return obj;
}
function toPromise ( obj ) { if ( ! obj ) { return obj ; } if ( isPromise ( obj ) ) { return obj ; } if ( isGeneratorFunction ( obj ) || isGenerator ( obj ) ) { return co . call ( this , obj ) ; } if ( 'function' == typeof obj ) { return thunkToPromise . call ( this , obj ) ; } if ( Array . isArray ( obj ) ) { return arrayToPromise . call ( this , obj ) ; } if ( isObject ( obj ) ) { return objectToPromise . call ( this , obj ) ; } return obj ; }
Convert a `yield`ed value into a promise.

@param {Mixed} obj
@return {Promise}
@api private
Convert a yield ed value into a promise .