Some cleanup

- Use whateverEmitter.event for the onWhatever methods.
- Add readonly to a bunch of things.
- Remove some redundancy in types.
- Move initializations out of the constructor and into the declarations
  where it was reasonable to do so.
- Disable a few no-any violations.
This commit is contained in:
Asher
2019-02-06 11:53:23 -06:00
parent ddf96077a3
commit 588da0443c
16 changed files with 98 additions and 164 deletions

View File

@ -20,12 +20,12 @@ export interface ServerOptions {
}
export class Server {
private readonly sessions: Map<number, Process> = new Map();
private readonly connections: Map<number, net.Socket> = new Map();
private readonly servers: Map<number, net.Server> = new Map();
private readonly evals: Map<number, ActiveEvaluation> = new Map();
private readonly sessions = new Map<number, Process>();
private readonly connections = new Map<number, net.Socket>();
private readonly servers = new Map<number, net.Server>();
private readonly evals = new Map<number, ActiveEvaluation>();
private connectionId: number = Number.MAX_SAFE_INTEGER;
private connectionId = Number.MAX_SAFE_INTEGER;
public constructor(
private readonly connection: ReadWriteConnection,