Skip to content

Commit

Permalink
[refactor] Remove tslint disable comment
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Oct 13, 2020
1 parent b5a44c2 commit 26941e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/piping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export class Server {
private static getNReceivers(reqUrl: string | undefined): number {
// Get query parameter
const query: ParsedUrlQuery | undefined =
// tslint:disable-next-line:max-line-length
// NOTE: Return type casting is safe because function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
(optMap(url.parse, reqUrl, true) as OptionalProperty<url.UrlWithParsedQuery>)
.query;
Expand Down Expand Up @@ -151,7 +150,6 @@ export class Server {
const scheme: string = (useHttps || xForwardedProtoIsHttps) ? "https" : "http";
// NOTE: req.headers.host contains port number
const hostname: string = req.headers.host ?? "hostname";
// tslint:disable-next-line:no-shadowed-variable
const url = `${scheme}://${hostname}`;

const helpPage: string = resources.generateHelpPage(url);
Expand Down Expand Up @@ -200,7 +198,6 @@ export class Server {
* @param path
* @param pipe
*/
// tslint:disable-next-line:no-shadowed-variable
private async runPipe(path: string, pipe: Pipe): Promise<void> {
// Add to established
this.pathToEstablished.add(path);
Expand Down Expand Up @@ -473,7 +470,6 @@ export class Server {
// If the path connection is not connecting
if (unestablishedPipe === undefined) {
// Create a receiver
/* tslint:disable:no-shadowed-variable */
const receiver = this.createSenderOrReceiver("receiver", req, res, reqPath);
// Set a receiver
this.pathToUnestablishedPipe.set(reqPath, {
Expand Down
9 changes: 0 additions & 9 deletions test/piping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ describe("piping.Server", () => {
assert.strictEqual(data.headers["content-length"], "this is a content".length.toString());
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (receiver?n=3: O, receiver?n=3: O, receiver?n=3: O, sender?n=3: O)", async () => {
// Get request promise
const dataPromise1 = thenRequest("GET", `${pipingUrl}/mydataid?n=3`);
Expand All @@ -436,7 +435,6 @@ describe("piping.Server", () => {
assert.strictEqual(data3.headers["content-length"], "this is a content".length.toString());
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (sender?n=3: O, receiver?n=3: O, receiver?n=3: O, receiver?n=3: O)", async () => {
// Send data
// (NOTE: Should NOT use `await` because of blocking GET requests)
Expand All @@ -461,7 +459,6 @@ describe("piping.Server", () => {
assert.strictEqual(data3.headers["content-length"], "this is a content".length.toString());
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (receiver?n=3: O, sender?n=3: O, receiver?n=3: O, receiver?n=3: O)", async () => {

// Get data
Expand Down Expand Up @@ -641,7 +638,6 @@ describe("piping.Server", () => {
getReq2.abort();
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (receiver?n=2: O, receiver?n=2: O, sender?n=1: X: because too less)", async () => {
// Get data
const getReq1 = request.get({
Expand All @@ -667,7 +663,6 @@ describe("piping.Server", () => {
getReq2.abort();
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (receiver?n=2: O, receiver?n=2: O, sender?n=3: X: because too much)", async () => {
// Get data
const getReq1 = request.get({
Expand All @@ -693,7 +688,6 @@ describe("piping.Server", () => {
getReq2.abort();
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (sender?n=2: O, receiver?n=2 O, receiver?n=3: X: because too much)", async () => {
// Create send request
const sendReq = http.request( {
Expand Down Expand Up @@ -726,7 +720,6 @@ describe("piping.Server", () => {
sendReq.abort();
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (sender?n=2: O, receiver?n=2 O, receiver?n=1: X: because too less)", async () => {
// Create send request
const sendReq = http.request( {
Expand Down Expand Up @@ -759,7 +752,6 @@ describe("piping.Server", () => {
sendReq.abort();
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (sender?n=2: O, receiver?n=2: O, receiver?n=2: O, receiver?n=2: X) to ensure gradual sending", async () => {
// Create send request
const sendReq = http.request( {
Expand Down Expand Up @@ -797,7 +789,6 @@ describe("piping.Server", () => {
assert.strictEqual(data3.headers["access-control-allow-origin"], "*");
});

// tslint:disable-next-line:max-line-length
it("should handle multi receiver connection (receiver?n=2: O, receiver?n=2: O, receiver?n=2: X, sender?n=2: O)", async () => {
// Get request promises
// (NOTE: Each sleep is to ensure the order of requests)
Expand Down

0 comments on commit 26941e1

Please sign in to comment.