Remove flow (not being used)

This commit is contained in:
Calvin Montgomery 2018-08-27 21:48:13 -07:00
parent 0bd11c3bba
commit c90d9c0ddc
4 changed files with 12 additions and 24 deletions

View file

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "3.57.1",
"version": "3.57.2",
"repository": {
"url": "http://github.com/calzoneman/sync"
},
@ -62,11 +62,9 @@
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-env": "^1.5.2",
"coffeescript": "^1.9.2",
"eslint": "^4.19.1",
"flow-bin": "^0.43.0",
"mocha": "^5.2.0",
"sinon": "^2.3.2"
},
@ -84,7 +82,6 @@
"plugins": [
"transform-async-to-generator",
"add-module-exports",
"transform-flow-strip-types",
"transform-decorators-legacy"
]
}

View file

@ -1,17 +1,15 @@
// @flow
import crypto from 'crypto';
import * as urlparse from 'url';
import { CamoConfig } from './configuration/camoconfig';
const LOGGER = require('@calzoneman/jsli')('camo');
function isWhitelisted(camoConfig: CamoConfig, url: string): boolean {
function isWhitelisted(camoConfig, url) {
const whitelistedDomains = camoConfig.getWhitelistedDomainsRegexp();
const parsed = urlparse.parse(url);
return whitelistedDomains.test('.' + parsed.hostname);
}
export function camoify(camoConfig: CamoConfig, url: string): string {
export function camoify(camoConfig, url) {
if (typeof url !== 'string') {
throw new TypeError(`camoify expected a string, not [${url}]`);
}
@ -33,7 +31,7 @@ export function camoify(camoConfig: CamoConfig, url: string): string {
}
}
export function transformImgTags(camoConfig: CamoConfig, tagName: string, attribs: Object) {
export function transformImgTags(camoConfig, tagName, attribs) {
if (typeof attribs.src === 'string') {
try {
const oldSrc = attribs.src;

View file

@ -1,18 +1,13 @@
// @flow
import { Database } from '../database';
import net from 'net';
const LOGGER = require('@calzoneman/jsli')('AliasesDB');
class AliasesDB {
db: Database;
constructor(db: Database) {
constructor(db) {
this.db = db;
}
async addAlias(ip: string, name: string) {
async addAlias(ip, name) {
return this.db.runTransaction(async tx => {
try {
await tx.table('aliases')
@ -27,7 +22,7 @@ class AliasesDB {
});
}
async getAliasesByIP(ip: string): Promise<Array<string>> {
async getAliasesByIP(ip) {
return this.db.runTransaction(async tx => {
const query = tx.table('aliases');
if (net.isIP(ip)) {
@ -45,7 +40,7 @@ class AliasesDB {
});
}
async getIPsByName(name: string): Promise<Array<string>> {
async getIPsByName(name) {
return this.db.runTransaction(async tx => {
const rows = await tx.table('aliases')
.select('ip')

View file

@ -1,5 +1,3 @@
// @flow
var fs = require("graceful-fs");
var path = require("path");
import { Logger as JsliLogger, LogLevel } from '@calzoneman/jsli';
@ -66,12 +64,12 @@ exports.syslog = syslog;
exports.eventlog = eventlog;
class LegacyLogger extends JsliLogger {
constructor(loggerName: string, level: LogLevel) {
constructor(loggerName, level) {
super(loggerName, level);
}
emitMessage(level: LogLevel, message: string) {
var output: string = `[${level.name}] ${this.loggerName}: ${message}`;
emitMessage(level, message) {
var output = `[${level.name}] ${this.loggerName}: ${message}`;
if (level.shouldLogAtLevel(LogLevel.ERROR)) {
errlog.log(output);
} else {
@ -81,7 +79,7 @@ class LegacyLogger extends JsliLogger {
}
// TODO: allow reconfiguration of log level at runtime
const level: LogLevel = process.env.DEBUG ? LogLevel.DEBUG : LogLevel.INFO;
const level = process.env.DEBUG ? LogLevel.DEBUG : LogLevel.INFO;
jsli.setLogBackend((loggerName) => {
return new LegacyLogger(loggerName, level);