Skip to content

Commit 16fc615

Browse files
committed
chore: rollback condition checks
1 parent 392f3f3 commit 16fc615

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/excel-builder-vanilla/src/streaming.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ export interface ExcelFileStreamOptions {
1616
* Yields zipped chunks for browser (ReadableStream) or NodeJS (async generator).
1717
*/
1818
export 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
}

0 commit comments

Comments
 (0)