mirror of
https://github.com/koush/scrypted.git
synced 2026-05-05 22:00:27 +01:00
fix: add definite assignment assertion for cancel variable
Add `!` assertion to cancel variable that is assigned in callback.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user