chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -66,8 +66,7 @@ function serviceSummary(label: string, svc: BonjourService): string {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
const state =
|
||||
typeof svc.serviceState === "string" ? svc.serviceState : "unknown";
|
||||
const state = typeof svc.serviceState === "string" ? svc.serviceState : "unknown";
|
||||
return `${label} fqdn=${fqdn} host=${hostname} port=${port} state=${state}`;
|
||||
}
|
||||
|
||||
@@ -157,23 +156,16 @@ export async function startGatewayBonjourAdvertiser(
|
||||
try {
|
||||
svc.on("name-change", (name: unknown) => {
|
||||
const next = typeof name === "string" ? name : String(name);
|
||||
logWarn(
|
||||
`bonjour: ${label} name conflict resolved; newName=${JSON.stringify(next)}`,
|
||||
);
|
||||
logWarn(`bonjour: ${label} name conflict resolved; newName=${JSON.stringify(next)}`);
|
||||
});
|
||||
svc.on("hostname-change", (nextHostname: unknown) => {
|
||||
const next =
|
||||
typeof nextHostname === "string"
|
||||
? nextHostname
|
||||
: String(nextHostname);
|
||||
const next = typeof nextHostname === "string" ? nextHostname : String(nextHostname);
|
||||
logWarn(
|
||||
`bonjour: ${label} hostname conflict resolved; newHostname=${JSON.stringify(next)}`,
|
||||
);
|
||||
});
|
||||
} catch (err) {
|
||||
logDebug(
|
||||
`bonjour: failed to attach listeners for ${label}: ${String(err)}`,
|
||||
);
|
||||
logDebug(`bonjour: failed to attach listeners for ${label}: ${String(err)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,8 +199,7 @@ export async function startGatewayBonjourAdvertiser(
|
||||
for (const { label, svc } of services) {
|
||||
const stateUnknown = (svc as { serviceState?: unknown }).serviceState;
|
||||
if (typeof stateUnknown !== "string") continue;
|
||||
if (stateUnknown === "announced" || stateUnknown === "announcing")
|
||||
continue;
|
||||
if (stateUnknown === "announced" || stateUnknown === "announcing") continue;
|
||||
|
||||
let key = label;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user