mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
refactor: remove unnecessary FlowFixMe (#1051)
This commit is contained in:
parent
d41a990e97
commit
919828fd32
7 changed files with 1 additions and 11 deletions
|
@ -39,7 +39,6 @@ export default function(router: Router, auth: IAuth, storage: IStorageHandler, c
|
|||
|
||||
// this is dumb and memory-consuming, but what choices do we have?
|
||||
// flow: we need first refactor this file before decides which type use here
|
||||
// $FlowFixMe
|
||||
stream.end(new Buffer(data.data, 'base64'));
|
||||
stream.done();
|
||||
};
|
||||
|
|
|
@ -28,7 +28,6 @@ export default function(config: Config, auth: IAuth, storage: IStorageHandler) {
|
|||
route.param('package', validatePackage);
|
||||
// $FlowFixMe
|
||||
route.param('filename', validateName);
|
||||
// $FlowFixMe
|
||||
route.param('version', validateName);
|
||||
route.param('anything', match(/.*/));
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
import assert from 'assert';
|
||||
import UrlNode from 'url';
|
||||
import _ from 'lodash';
|
||||
// $FlowFixMe
|
||||
import { ErrorCode, isObject, getLatestVersion, tagVersion, validateName } from './utils';
|
||||
import { generatePackageTemplate, normalizePackage, generateRevision, getLatestReadme, cleanUpReadme, normalizeContributors } from './storage-utils';
|
||||
import { API_ERROR, DIST_TAGS, STORAGE } from './constants';
|
||||
|
|
|
@ -145,7 +145,6 @@ export function publishPackage(name: string, metadata: any, localStorage: IStora
|
|||
|
||||
export function checkPackageRemote(name: string, isAllowPublishOffline: boolean, syncMetadata: Function): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
// $FlowFixMe
|
||||
syncMetadata(name, null, {}, (err, packageJsonLocal, upLinksErrors) => {
|
||||
// something weird
|
||||
if (err && err.status !== HTTP_STATUS.NOT_FOUND) {
|
||||
|
|
|
@ -145,7 +145,6 @@ class Storage implements IStorageHandler {
|
|||
// local reported 404
|
||||
let err404 = err;
|
||||
localStream.abort();
|
||||
// $FlowFixMe
|
||||
localStream = null; // we force for garbage collector
|
||||
self.localStorage.getPackageMetadata(name, (err, info: Package) => {
|
||||
if (_.isNil(err) && info._distfiles && _.isNil(info._distfiles[filename]) === false) {
|
||||
|
@ -182,7 +181,6 @@ class Storage implements IStorageHandler {
|
|||
let uplink: any = null;
|
||||
|
||||
for (let uplinkId in self.uplinks) {
|
||||
// $FlowFixMe
|
||||
if (self.uplinks[uplinkId].isUplinkValid(file.url)) {
|
||||
uplink = self.uplinks[uplinkId];
|
||||
}
|
||||
|
@ -441,7 +439,6 @@ class Storage implements IStorageHandler {
|
|||
}
|
||||
|
||||
if (err || !upLinkResponse) {
|
||||
// $FlowFixMe
|
||||
return cb(null, [err || ErrorCode.getInternalError('no data')]);
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,6 @@ class ProxyStorage implements IProxy {
|
|||
if (cb) {
|
||||
cb(ErrorCode.getInternalError(API_ERROR.UPLINK_OFFLINE));
|
||||
}
|
||||
// $FlowFixMe
|
||||
streamRead.emit('error', ErrorCode.getInternalError(API_ERROR.UPLINK_OFFLINE));
|
||||
});
|
||||
// $FlowFixMe
|
||||
|
@ -297,7 +296,6 @@ class ProxyStorage implements IProxy {
|
|||
if (_.isNil(tokenConf.token) === false && _.isString(tokenConf.token)) {
|
||||
token = tokenConf.token;
|
||||
} else if (_.isNil(tokenConf.token_env) === false) {
|
||||
// $FlowFixMe
|
||||
if (_.isString(tokenConf.token_env)) {
|
||||
token = process.env[tokenConf.token_env];
|
||||
} else if (_.isBoolean(tokenConf.token_env) && tokenConf.token_env) {
|
||||
|
@ -392,7 +390,6 @@ class ProxyStorage implements IProxy {
|
|||
const getHost = urlDomainParsed => (isHTTPS(urlDomainParsed) ? urlDomainParsed.hostname : urlDomainParsed.host);
|
||||
const isMatchProtocol: boolean = urlParsed.protocol === this.url.protocol;
|
||||
const isMatchHost: boolean = getHost(urlParsed) === getHost(this.url);
|
||||
// $FlowFixMe
|
||||
const isMatchPath: boolean = urlParsed.path.indexOf(this.url.path) === 0;
|
||||
|
||||
return isMatchProtocol && isMatchHost && isMatchPath;
|
||||
|
|
|
@ -98,7 +98,7 @@ describe('Config Utilities', () => {
|
|||
// $FlowFixMe
|
||||
expect(react.access[0]).toBe(ROLES.$ALL);
|
||||
expect(react.publish).toBeDefined();
|
||||
// $FlowFixMe);
|
||||
// $FlowFixMe
|
||||
expect(react.publish[0]).toBe('admin');
|
||||
expect(react.proxy).toBeDefined();
|
||||
// $FlowFixMe
|
||||
|
|
Loading…
Reference in a new issue