File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/excel-builder-vanilla/src Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,11 @@ export interface ExcelFileStreamOptions {
1616 * Yields zipped chunks for browser (ReadableStream) or NodeJS (async generator).
1717 */
1818export function createExcelFileStream ( workbook : Workbook , options ?: ExcelFileStreamOptions ) {
19- const isBrowser = typeof window ?. ReadableStream !== 'undefined' ;
20- const isNode = typeof process ?. versions ?. node !== 'undefined' ;
21- if ( isBrowser ) {
22- return browserExcelStream ( workbook , options ) ;
19+ if ( typeof window !== 'undefined' && typeof window . ReadableStream !== 'undefined' ) {
20+ return browserExcelStream ( workbook , options ) ; // Browser environment
2321 }
24- if ( isNode ) {
25- return nodeExcelStream ( workbook , options ) ;
22+ if ( typeof process !== 'undefined' && process . versions ?. node ) {
23+ return nodeExcelStream ( workbook , options ) ; // NodeJS environment
2624 }
2725 throw new Error ( 'Streaming is only supported in browser or NodeJS environments.' ) ;
2826}
You can’t perform that action at this time.
0 commit comments