0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-25 02:32:52 -05:00

Add jsdoc to stream.js

This commit is contained in:
Juan Picado 2017-04-27 03:50:04 +02:00
parent 105a34f912
commit 318634f072
No known key found for this signature in database
GPG key ID: 18AC54485952D158

View file

@ -1,16 +1,15 @@
'use strict'; 'use strict';
let Stream = require('stream'); const Stream = require('stream');
let Util = require('util'); const Util = require('util');
module.exports.ReadTarballStream = ReadTarball; /**
module.exports.UploadTarballStream = UploadTarball; * This stream is used to read tarballs from repository.
* @param {*} options
// * @return {Object}
// This stream is used to read tarballs from repository */
//
function ReadTarball(options) { function ReadTarball(options) {
let self = new Stream.PassThrough(options); const self = new Stream.PassThrough(options);
Object.setPrototypeOf(self, ReadTarball.prototype); Object.setPrototypeOf(self, ReadTarball.prototype);
// called when data is not needed anymore // called when data is not needed anymore
@ -21,11 +20,13 @@ function ReadTarball(options) {
Util.inherits(ReadTarball, Stream.PassThrough); Util.inherits(ReadTarball, Stream.PassThrough);
// /**
// This stream is used to upload tarballs to a repository * This stream is used to upload tarballs to a repository.
// * @param {*} options
* @return {Object}
*/
function UploadTarball(options) { function UploadTarball(options) {
let self = new Stream.PassThrough(options); const self = new Stream.PassThrough(options);
Object.setPrototypeOf(self, UploadTarball.prototype); Object.setPrototypeOf(self, UploadTarball.prototype);
// called when user closes connection before upload finishes // called when user closes connection before upload finishes
@ -39,10 +40,12 @@ function UploadTarball(options) {
Util.inherits(UploadTarball, Stream.PassThrough); Util.inherits(UploadTarball, Stream.PassThrough);
// /**
// This function intercepts abstract calls and replays them allowing * This function intercepts abstract calls and replays them allowing.
// us to attach those functions after we are ready to do so * us to attach those functions after we are ready to do so
// * @param {*} self
* @param {*} name
*/
function add_abstract_method(self, name) { function add_abstract_method(self, name) {
self._called_methods = self._called_methods || {}; self._called_methods = self._called_methods || {};
self.__defineGetter__(name, function() { self.__defineGetter__(name, function() {
@ -60,3 +63,5 @@ function add_abstract_method(self, name) {
}); });
} }
module.exports.ReadTarballStream = ReadTarball;
module.exports.UploadTarballStream = UploadTarball;