mirror of
https://github.com/strapi/strapi.git
synced 2025-11-08 14:19:40 +00:00
remove stream-mock
This commit is contained in:
parent
96846061b5
commit
68a76aa185
@ -1,4 +1,4 @@
|
|||||||
import { ObjectWritableMock, ObjectReadableMock } from 'stream-mock';
|
import { Readable, Writable } from 'stream-chain';
|
||||||
import { createTransferEngine } from '..';
|
import { createTransferEngine } from '..';
|
||||||
import {
|
import {
|
||||||
IDestinationProvider,
|
IDestinationProvider,
|
||||||
@ -10,16 +10,17 @@ import {
|
|||||||
const providerStages = ['bootstrap', 'close'];
|
const providerStages = ['bootstrap', 'close'];
|
||||||
|
|
||||||
const getMockSourceStream = (data: Iterable<any> = ['foo', 'bar']) => {
|
const getMockSourceStream = (data: Iterable<any> = ['foo', 'bar']) => {
|
||||||
const stream = new ObjectReadableMock(data).on('close', () => {
|
const stream = Readable.from(data);
|
||||||
stream.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
return stream;
|
return stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getMockDestinationStream = () => {
|
const getMockDestinationStream = () => {
|
||||||
const stream = new ObjectWritableMock().on('close', () => {
|
const stream = new Writable({
|
||||||
stream.destroy();
|
objectMode: true,
|
||||||
|
write(chunk, encoding, callback) {
|
||||||
|
callback();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
return stream;
|
return stream;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -55,7 +55,6 @@
|
|||||||
"@types/stream-json": "1.7.2",
|
"@types/stream-json": "1.7.2",
|
||||||
"@types/tar": "6.1.3",
|
"@types/tar": "6.1.3",
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
"stream-mock": "2.0.5",
|
|
||||||
"typescript": "4.6.2"
|
"typescript": "4.6.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@ -20830,11 +20830,6 @@ stream-json@1.7.4:
|
|||||||
dependencies:
|
dependencies:
|
||||||
stream-chain "^2.2.5"
|
stream-chain "^2.2.5"
|
||||||
|
|
||||||
stream-mock@2.0.5:
|
|
||||||
version "2.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/stream-mock/-/stream-mock-2.0.5.tgz#c99d24bd6dbb0eaa57cf6ffefdb064150747826e"
|
|
||||||
integrity sha512-dx9skT8QYjwLsal+MhGHr4UtgS49brw851C/oTixmhCi4Ip+/qnZmhV1qOcznYYAED6gYKmKea+jjza4/wjpSg==
|
|
||||||
|
|
||||||
stream-shift@^1.0.0:
|
stream-shift@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
|
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user