fix: add definite assignment assertion for cancel variable

Add `!` assertion to cancel variable that is assigned in callback.
This commit is contained in:
Koushik Dutta
2026-04-02 12:45:15 -07:00
parent bc8f1ebc97
commit 8c5b2f48cc

View File

@@ -18,7 +18,7 @@ export async function listenZeroSingleClient(hostname: string, options?: net.Ser
const server = options?.tls ? new tls.Server(options) : new net.Server(options);
const port = await listenZero(server, hostname);
let cancel: () => void;
let cancel!: () => void;
const clientPromise = new Promise<net.Socket>((resolve, reject) => {
const timeout = setTimeout(() => {
server.close();