Compare commits

..

2 Commits

Author SHA1 Message Date
36a5c2480f 2.0.2 2021-04-19 12:15:24 +00:00
70a08fd92b fix(core): update 2021-04-19 12:15:23 +00:00
4 changed files with 24 additions and 12 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartarchive",
"version": "2.0.1",
"version": "2.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartarchive",
"version": "2.0.1",
"version": "2.0.2",
"description": "work with archives",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",

View File

@ -60,23 +60,35 @@ tap.test('should extract a package using tarStream', async (tools) => {
const extractionFileObservable = await testSmartarchive.extractArchiveFromBufferToObservable(
testTgzBuffer
);
const subscription = extractionFileObservable.subscribe(file => {
console.log(file.path);
});
await tools.delayFor(2000);
done.resolve();
const subscription = extractionFileObservable.subscribe(
(file) => {
console.log(file.path);
},
(err) => {
console.log(err);
},
() => {
done.resolve();
}
);
await done.promise;
});
tap.test('should extract a file from url to replaySubject', async (tools) => {
const done = tools.defer();
const testSmartarchive = new smartarchive.SmartArchive();
const extractionFileObservable = await testSmartarchive.extractArchiveFromUrlToObservable('https://verdaccio.lossless.one/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz');
const subscription = extractionFileObservable.subscribe(file => {
const extractionFileObservable = await testSmartarchive.extractArchiveFromUrlToObservable(
'https://verdaccio.lossless.one/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz'
);
const subscription = extractionFileObservable.subscribe((file) => {
console.log(file.path);
},
(err) => {
console.log(err);
},
() => {
done.resolve();
});
await tools.delayFor(2000);
done.resolve();
await done.promise;
});

View File

@ -68,7 +68,7 @@ export class SmartArchive {
stream.resume();
});
extractPipeStop.on('finish', () => {
replaySubject.unsubscribe();
replaySubject.complete();
});
// lets run the stream
readableStream