From 2771408ff61c0c41808de2f1b671b3d615027374 Mon Sep 17 00:00:00 2001 From: Andy Chou Date: Mon, 14 May 2018 11:56:39 -0700 Subject: [PATCH 1/2] memory-fs: Make options optional for createReadStream, createWriteStream --- types/memory-fs/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/memory-fs/index.d.ts b/types/memory-fs/index.d.ts index 9578bb3548..23b3f0aef9 100644 --- a/types/memory-fs/index.d.ts +++ b/types/memory-fs/index.d.ts @@ -43,13 +43,13 @@ declare class MemoryFileSystem { writeFileSync(_path: string, content: string | Buffer, encoding?: string): void; createReadStream( - path: string, options: { + path: string, options?: { start: number; end: number; } ): any; - createWriteStream(path: string, options: any): any; + createWriteStream(path: string, options?: any): any; exists(path: string, callback: (isExist: boolean) => any): any; From c613604da564f02652fe511147c405af67d88696 Mon Sep 17 00:00:00 2001 From: Andy Chou Date: Mon, 14 May 2018 11:58:48 -0700 Subject: [PATCH 2/2] memory-fs: create test for optional options --- types/memory-fs/test/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/memory-fs/test/index.ts b/types/memory-fs/test/index.ts index 07abb3e3fe..16d477baf2 100644 --- a/types/memory-fs/test/index.ts +++ b/types/memory-fs/test/index.ts @@ -15,3 +15,7 @@ fs.writeFile('hello', 'hahahahah', 'utf-8', function (err) { console.log(err.message); } }); + +fs.createReadStream('hello'); + +fs.createWriteStream('hello'); \ No newline at end of file