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:
parent
105a34f912
commit
318634f072
1 changed files with 22 additions and 17 deletions
|
@ -1,16 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
let Stream = require('stream');
|
||||
let Util = require('util');
|
||||
const Stream = require('stream');
|
||||
const Util = require('util');
|
||||
|
||||
module.exports.ReadTarballStream = ReadTarball;
|
||||
module.exports.UploadTarballStream = UploadTarball;
|
||||
|
||||
//
|
||||
// This stream is used to read tarballs from repository
|
||||
//
|
||||
/**
|
||||
* This stream is used to read tarballs from repository.
|
||||
* @param {*} options
|
||||
* @return {Object}
|
||||
*/
|
||||
function ReadTarball(options) {
|
||||
let self = new Stream.PassThrough(options);
|
||||
const self = new Stream.PassThrough(options);
|
||||
Object.setPrototypeOf(self, ReadTarball.prototype);
|
||||
|
||||
// called when data is not needed anymore
|
||||
|
@ -21,11 +20,13 @@ function ReadTarball(options) {
|
|||
|
||||
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) {
|
||||
let self = new Stream.PassThrough(options);
|
||||
const self = new Stream.PassThrough(options);
|
||||
Object.setPrototypeOf(self, UploadTarball.prototype);
|
||||
|
||||
// called when user closes connection before upload finishes
|
||||
|
@ -39,10 +40,12 @@ function UploadTarball(options) {
|
|||
|
||||
Util.inherits(UploadTarball, Stream.PassThrough);
|
||||
|
||||
//
|
||||
// This function intercepts abstract calls and replays them allowing
|
||||
// us to attach those functions after we are ready to do so
|
||||
//
|
||||
/**
|
||||
* This function intercepts abstract calls and replays them allowing.
|
||||
* us to attach those functions after we are ready to do so
|
||||
* @param {*} self
|
||||
* @param {*} name
|
||||
*/
|
||||
function add_abstract_method(self, name) {
|
||||
self._called_methods = self._called_methods || {};
|
||||
self.__defineGetter__(name, function() {
|
||||
|
@ -60,3 +63,5 @@ function add_abstract_method(self, name) {
|
|||
});
|
||||
}
|
||||
|
||||
module.exports.ReadTarballStream = ReadTarball;
|
||||
module.exports.UploadTarballStream = UploadTarball;
|
||||
|
|
Loading…
Add table
Reference in a new issue