@verdaccio/streams
Advanced tools
Comparing version 10.2.0 to 10.2.1
@@ -7,5 +7,3 @@ "use strict"; | ||
exports.UploadTarball = exports.ReadTarball = void 0; | ||
var _stream = require("stream"); | ||
/** | ||
@@ -22,10 +20,9 @@ * This stream is used to read tarballs from repository. | ||
constructor(options) { | ||
super(options); // called when data is not needed anymore | ||
super(options); | ||
// called when data is not needed anymore | ||
addAbstractMethods(this, 'abort'); | ||
} | ||
abort() {} | ||
} | ||
} | ||
/** | ||
@@ -36,6 +33,3 @@ * This stream is used to upload tarballs to a repository. | ||
*/ | ||
exports.ReadTarball = ReadTarball; | ||
class UploadTarball extends _stream.PassThrough { | ||
@@ -47,14 +41,13 @@ /** | ||
constructor(options) { | ||
super(options); // called when user closes connection before upload finishes | ||
super(options); | ||
// called when user closes connection before upload finishes | ||
addAbstractMethods(this, 'abort'); | ||
addAbstractMethods(this, 'abort'); // called when upload finishes successfully | ||
// called when upload finishes successfully | ||
addAbstractMethods(this, 'done'); | ||
} | ||
abort() {} | ||
done() {} | ||
} | ||
} | ||
/** | ||
@@ -67,9 +60,5 @@ * This function intercepts abstract calls and replays them allowing. | ||
// Perhaps someone knows a better way to write this | ||
exports.UploadTarball = UploadTarball; | ||
function addAbstractMethods(self, name) { | ||
self._called_methods = self._called_methods || {}; | ||
self.__defineGetter__(name, function () { | ||
@@ -80,7 +69,5 @@ return function () { | ||
}); | ||
self.__defineSetter__(name, function (fn) { | ||
delete self[name]; | ||
self[name] = fn; | ||
if (self._called_methods && self._called_methods[name]) { | ||
@@ -87,0 +74,0 @@ delete self._called_methods[name]; |
{ | ||
"name": "@verdaccio/streams", | ||
"version": "10.2.0", | ||
"version": "10.2.1", | ||
"description": "Stream extension for Verdaccio", | ||
@@ -29,7 +29,7 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=8", | ||
"node": ">=12", | ||
"npm": ">=5" | ||
}, | ||
"devDependencies": { | ||
"@verdaccio/types": "10.3.0" | ||
"@verdaccio/legacy-types": "1.0.1" | ||
}, | ||
@@ -48,4 +48,3 @@ "funding": { | ||
"build": "pnpm run build:js && pnpm run build:types" | ||
}, | ||
"readme": "# Streams\n\n[![CircleCI](https://circleci.com/gh/verdaccio/streams.svg?style=svg)](https://circleci.com/gh/ayusharma/@verdaccio/streams)\n[![codecov](https://codecov.io/gh/verdaccio/streams/branch/master/graph/badge.svg)](https://codecov.io/gh/verdaccio/streams)\n[![verdaccio (latest)](https://img.shields.io/npm/v/@verdaccio/streams/latest.svg)](https://www.npmjs.com/package/@verdaccio/streams)\n[![backers](https://opencollective.com/verdaccio/tiers/backer/badge.svg?label=Backer&color=brightgreen)](https://opencollective.com/verdaccio)\n[![discord](https://img.shields.io/discord/388674437219745793.svg)](http://chat.verdaccio.org/)\n![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)\n[![node](https://img.shields.io/node/v/@verdaccio/streams/latest.svg)](https://www.npmjs.com/package/@verdaccio/streams)\n\n\nThis project provides an extension of `PassThrough` stream.\n\n## Detail\n\nIt provides 2 additional methods `abort()` and `done()`. Those implementations are widely use in the verdaccio core for handle `tarballs`.\n\n## License\n\nMIT (http://www.opensource.org/licenses/mit-license.php)\n" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105
9536