Skip to content

Commit f221c37

Browse files
committed
refactor: split destructuring for host_ in QUICClient and QUICSocket to silence linter error
1 parent a742528 commit f221c37

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/QUICClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,13 @@ class QUICClient {
141141
await crypto.ops.randomBytes(scidBuffer);
142142
const scid = new QUICConnectionId(scidBuffer);
143143
// Validating host and port types
144-
let [host_, udpType] = await utils.resolveHost(host, resolveHostname);
144+
const [tmpHost, udpType] = await utils.resolveHost(host, resolveHostname);
145145
const port_ = utils.toPort(port);
146146
// If the target host is in fact a zero IP, it cannot be used
147147
// as a target host, so we need to resolve it to a non-zero IP
148148
// in this case, 0.0.0.0 is resolved to 127.0.0.1 and :: and ::0 is
149149
// resolved to ::1.
150+
let host_ = tmpHost;
150151
host_ = utils.resolvesZeroIP(host_);
151152
let isSocketShared: boolean;
152153
if (socket == null) {

src/QUICSocket.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,11 @@ class QUICSocket {
396396
);
397397
}
398398
const host = params[index] as Host | Hostname;
399-
let [host_, udpType] = await utils.resolveHost(host, this.resolveHostname);
399+
const [tmpHost, udpType] = await utils.resolveHost(
400+
host,
401+
this.resolveHostname,
402+
);
403+
let host_ = tmpHost;
400404
host_ = utils.resolvesZeroIP(host_);
401405
host_ = utils.validateTarget(
402406
this._host,

0 commit comments

Comments
 (0)