refactor: Remove streamify array dependency

This commit is contained in:
Joachim Van Herwegen
2021-08-02 13:29:52 +02:00
parent 63e88578c3
commit 2ae95bd167
12 changed files with 70 additions and 106 deletions

View File

@@ -1,7 +1,5 @@
import type { Dirent, Stats } from 'fs';
import { PassThrough } from 'stream';
import streamifyArray from 'streamify-array';
import { PassThrough, Readable } from 'stream';
import type { SystemError } from '../../src/util/errors/SystemError';
const portNames = [
@@ -95,7 +93,7 @@ export function mockFs(rootFilepath?: string, time?: Date): { data: any } {
const mock = {
createReadStream(path: string): any {
const { folder, name } = getFolder(path);
return streamifyArray([ folder[name] ]);
return Readable.from([ folder[name] ]);
},
createWriteStream(path: string): any {
const { folder, name } = getFolder(path);