@verdaccio/streams
Advanced tools
Comparing version 0.0.2 to 1.0.0
@@ -10,8 +10,2 @@ 'use strict'; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
/** | ||
@@ -22,4 +16,3 @@ * This stream is used to read tarballs from repository. | ||
*/ | ||
var ReadTarball = function (_PassThrough) { | ||
_inherits(ReadTarball, _PassThrough); | ||
class ReadTarball extends _stream.PassThrough { | ||
@@ -30,15 +23,9 @@ /** | ||
*/ | ||
function ReadTarball(options) { | ||
_classCallCheck(this, ReadTarball); | ||
constructor(options) { | ||
super(options); | ||
// called when data is not needed anymore | ||
var _this = _possibleConstructorReturn(this, (ReadTarball.__proto__ || Object.getPrototypeOf(ReadTarball)).call(this, options)); | ||
addAbstractMethods(_this, 'abort'); | ||
return _this; | ||
addAbstractMethods(this, 'abort'); | ||
} | ||
} | ||
return ReadTarball; | ||
}(_stream.PassThrough); | ||
/** | ||
@@ -51,4 +38,3 @@ * This stream is used to upload tarballs to a repository. | ||
var UploadTarball = function (_PassThrough2) { | ||
_inherits(UploadTarball, _PassThrough2); | ||
class UploadTarball extends _stream.PassThrough { | ||
@@ -59,18 +45,12 @@ /** | ||
*/ | ||
function UploadTarball(options) { | ||
_classCallCheck(this, UploadTarball); | ||
constructor(options) { | ||
super(options); | ||
// called when user closes connection before upload finishes | ||
var _this2 = _possibleConstructorReturn(this, (UploadTarball.__proto__ || Object.getPrototypeOf(UploadTarball)).call(this, options)); | ||
addAbstractMethods(this, 'abort'); | ||
addAbstractMethods(_this2, 'abort'); | ||
// called when upload finishes successfully | ||
addAbstractMethods(_this2, 'done'); | ||
return _this2; | ||
addAbstractMethods(this, 'done'); | ||
} | ||
} | ||
return UploadTarball; | ||
}(_stream.PassThrough); | ||
/** | ||
@@ -82,16 +62,23 @@ * This function intercepts abstract calls and replays them allowing. | ||
*/ | ||
// Perhaps someone knows a better way to write this | ||
function addAbstractMethods(self, name) { | ||
// $FlowFixMe | ||
self._called_methods = self._called_methods || {}; | ||
// $FlowFixMe | ||
self.__defineGetter__(name, function () { | ||
return function () { | ||
// $FlowFixMe | ||
self._called_methods[name] = true; | ||
}; | ||
}); | ||
// $FlowFixMe | ||
self.__defineSetter__(name, function (fn) { | ||
// $FlowFixMe | ||
delete self[name]; | ||
// $FlowFixMe | ||
self[name] = fn; | ||
// $FlowFixMe | ||
if (self._called_methods && self._called_methods[name]) { | ||
delete self._called_methods[name]; | ||
// $FlowFixMe | ||
self[name](); | ||
@@ -98,0 +85,0 @@ } |
{ | ||
"name": "@verdaccio/streams", | ||
"version": "0.0.2", | ||
"version": "1.0.0", | ||
"description": "helper to delay streams", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "npm run lint && mocha --require babel-polyfill --compilers js:babel-core/register ./test/**/*.spec.js", | ||
"precommit": "lint-staged", | ||
"test": "npm run lint && jest", | ||
"lint": "eslint .", | ||
"prepublish": "npm run build", | ||
"build": "babel src/ --out-dir lib/ --copy-files", | ||
@@ -13,25 +15,32 @@ "cover": "cross-env NODE_ENV=test nyc npm t" | ||
"devDependencies": { | ||
"@verdaccio/types": "0.2.0", | ||
"babel-cli": "6.24.1", | ||
"babel-core": "6.25.0", | ||
"babel-eslint": "7.2.3", | ||
"babel-jest": "21.2.0", | ||
"babel-plugin-flow-runtime": "0.11.1", | ||
"babel-plugin-istanbul": "4.1.4", | ||
"babel-polyfill": "6.23.0", | ||
"babel-preset-es2015": "6.24.1", | ||
"babel-preset-env": "1.6.1", | ||
"babel-preset-flow": "6.23.0", | ||
"cross-env": "5.0.1", | ||
"eslint": "4.1.1", | ||
"eslint-config-google": "0.9.1", | ||
"mocha": "3.4.2", | ||
"nyc": "11.0.3" | ||
"eslint-plugin-flowtype": "2.41.0", | ||
"eslint-plugin-jest": "21.2.0", | ||
"flow-bin": "0.52.0", | ||
"flow-runtime": "0.13.0", | ||
"husky": "0.14.3", | ||
"jest": "21.2.1", | ||
"lint-staged": "6.0.0", | ||
"prettier": "1.10.2" | ||
}, | ||
"nyc": { | ||
"include": [ | ||
"src/**/*.js" | ||
], | ||
"all": true, | ||
"cache": true, | ||
"sourceMap": false, | ||
"instrument": false, | ||
"report-dir": "./tests-report", | ||
"reporter": [ | ||
"text", | ||
"html" | ||
"engines": { | ||
"node": ">=6.12.0", | ||
"npm": ">=3" | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --fix", | ||
"git add" | ||
] | ||
@@ -43,3 +52,4 @@ }, | ||
"keywords": [ | ||
"streams" | ||
"streams", | ||
"verdaccio" | ||
], | ||
@@ -46,0 +56,0 @@ "author": "Juan Picado <juanpicado19@gmail.com>", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
66230
20
961
1
0
5
21
1