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';
55import { newNotAllowedError } from './util' ;
66import { FLAGS , MODE } from '../node/constants' ;
77
8+ declare const require : any ;
9+ const WS = ( typeof WritableStream === 'undefined' ? require ( 'stream/web' ) . WritableStream : WritableStream ) as typeof WritableStream ;
10+
811/**
912 * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream
1013 */
11- export class CoreFileSystemWritableFileStream extends WritableStream implements IFileSystemWritableFileStream {
14+ export class CoreFileSystemWritableFileStream extends WS implements IFileSystemWritableFileStream {
1215 private _fd : number | undefined ;
1316 private _position : number = 0 ;
1417 private _closed = false ;
Original file line number Diff line number Diff line change @@ -51,14 +51,17 @@ interface SwapFile {
5151 ready ?: Promise < void > ;
5252}
5353
54+ declare const require : any ;
55+ const WS = ( typeof WritableStream === 'undefined' ? require ( 'stream/web' ) . WritableStream : WritableStream ) as typeof WritableStream ;
56+
5457/**
5558 * Is a WritableStream object with additional convenience methods, which
5659 * operates on a single file on disk. The interface is accessed through the
5760 * `FileSystemFileHandle.createWritable()` method.
5861 *
5962 * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream
6063 */
61- export class NodeFileSystemWritableFileStream extends WritableStream implements IFileSystemWritableFileStream {
64+ export class NodeFileSystemWritableFileStream extends WS implements IFileSystemWritableFileStream {
6265 protected readonly swap : SwapFile ;
6366
6467 constructor (
You can’t perform that action at this time.
0 commit comments