slightly improve types

This commit is contained in:
Alistair Smith
2025-05-06 11:31:06 -07:00
parent 307262df49
commit 52ef449eee

View File

@@ -167,7 +167,7 @@ function onConnectEnd() {
}
}
const SocketHandlers: SocketHandler = {
const SocketHandlers = {
close(socket, err) {
const self = socket.data;
if (!self || self[kclosed]) return;
@@ -300,7 +300,8 @@ const SocketHandlers: SocketHandler = {
self.emit("timeout", self);
},
binaryType: "buffer",
};
// TODO: We can improve the type of the socket here
} satisfies SocketHandler<import("net").Socket & { [Key in PropertyKey]: unknown }, "buffer">;
const SocketEmitEndNT = (self, _err?) => {
if (!self[kended]) {