lib/index.js
function readerToStream(reader) {
    return new ReadableStream({
        pull(controller) {
            return reader.read()
                .then(res => {
                    if (res.done) {
                        controller.close();
                    } else {
                        controller.enqueue(res.value);
                    }
                });
        },
        cancel(reason) { return reader.cancel(reason); }
    });
}
function readerToStream(reader) {
    return new ReadableStream({
        pull(controller) {
            return reader.read()
                .then(res => {
                    if (res.done) {
                        controller.close();
                    } else {
                        controller.enqueue(res.value);
                    }
                });
        },
        cancel(reason) { return reader.cancel(reason); }
    });
}
function readerToStream ( reader ) { return new ReadableStream ( { pull ( controller ) { return reader . read ( ) . then ( res => { if ( res . done ) { controller . close ( ) ; } else { controller . enqueue ( res . value ) ; } } ) ; } , cancel ( reason ) { return reader . cancel ( reason ) ; } } ) ; }
Adapt a Reader to an UnderlyingSource, for wrapping into a ReadableStream.

@param {Reader} reader
@return {ReadableStream}
Adapt a Reader to an UnderlyingSource for wrapping into a ReadableStream .