File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,13 @@ import { ERROR_CODE } from '../core/constants';
5
5
import { newNotAllowedError } from './util' ;
6
6
import { FLAGS , MODE } from '../node/constants' ;
7
7
8
+ declare const require : any ;
9
+ const WS = ( typeof WritableStream === 'undefined' ? require ( 'stream/web' ) . WritableStream : WritableStream ) as typeof WritableStream ;
10
+
8
11
/**
9
12
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream
10
13
*/
11
- export class CoreFileSystemWritableFileStream extends WritableStream implements IFileSystemWritableFileStream {
14
+ export class CoreFileSystemWritableFileStream extends WS implements IFileSystemWritableFileStream {
12
15
private _fd : number | undefined ;
13
16
private _position : number = 0 ;
14
17
private _closed = false ;
Original file line number Diff line number Diff line change @@ -51,14 +51,17 @@ interface SwapFile {
51
51
ready ?: Promise < void > ;
52
52
}
53
53
54
+ declare const require : any ;
55
+ const WS = ( typeof WritableStream === 'undefined' ? require ( 'stream/web' ) . WritableStream : WritableStream ) as typeof WritableStream ;
56
+
54
57
/**
55
58
* Is a WritableStream object with additional convenience methods, which
56
59
* operates on a single file on disk. The interface is accessed through the
57
60
* `FileSystemFileHandle.createWritable()` method.
58
61
*
59
62
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream
60
63
*/
61
- export class NodeFileSystemWritableFileStream extends WritableStream implements IFileSystemWritableFileStream {
64
+ export class NodeFileSystemWritableFileStream extends WS implements IFileSystemWritableFileStream {
62
65
protected readonly swap : SwapFile ;
63
66
64
67
constructor (
You can’t perform that action at this time.
0 commit comments