8 lines
		
	
	
		
			201 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
		
			201 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
export async function splitStream(stream) {
 | 
						|
    if (typeof stream.stream === "function") {
 | 
						|
        stream = stream.stream();
 | 
						|
    }
 | 
						|
    const readableStream = stream;
 | 
						|
    return readableStream.tee();
 | 
						|
}
 |