Skip to content

Commit

Permalink
fix: correct types
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 14, 2021
1 parent 56af963 commit 5e8c71d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions src/factories/createInternalHttpTerminator.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/* eslint-disable import/order */

import http from 'http';
import type {
Socket,
} from 'net';
import type {
TLSSocket,
} from 'tls';
import delay from 'delay';
import type {
Duplex,
} from 'node:stream';
import Logger from '../Logger';
import type {
HttpTerminatorConfigurationInput,
Expand All @@ -30,8 +29,8 @@ export default (

const server = configuration.server;

const sockets = new Set<Socket>();
const secureSockets = new Set<TLSSocket>();
const sockets = new Set<Duplex>();
const secureSockets = new Set<Duplex>();

let terminating;

Expand Down
8 changes: 4 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type {
Server as HttpsServer,
} from 'https';
import type {
Socket,
} from 'net';
Duplex,
} from 'node:stream';
import type {
Merge,
} from 'type-fest';
Expand All @@ -28,6 +28,6 @@ export type HttpTerminator = {
};

export type InternalHttpTerminator = Merge<HttpTerminator, {
readonly secureSockets: Set<Socket>,
readonly sockets: Set<Socket>,
readonly secureSockets: Set<Duplex>,
readonly sockets: Set<Duplex>,
}>;

0 comments on commit 5e8c71d

Please # to comment.