Update contributing, deduplicate more functions

This commit is contained in:
quotentiroler
2026-02-09 19:21:33 -08:00
parent 453eaed4dc
commit cc87c0ed7c
13 changed files with 96 additions and 100 deletions

View File

@@ -11,7 +11,7 @@ import { CONFIG_PATH } from "../config/config.js";
import { resolveSessionTranscriptsDirForAgent } from "../config/sessions.js";
import { callGateway } from "../gateway/call.js";
import { normalizeControlUiBasePath } from "../gateway/control-ui-shared.js";
import { pickPrimaryLanIPv4 } from "../gateway/net.js";
import { pickPrimaryLanIPv4, isValidIPv4 } from "../gateway/net.js";
import { isSafeExecutableValue } from "../infra/exec-safety.js";
import { pickPrimaryTailnetIPv4 } from "../infra/tailnet.js";
import { isWSL } from "../infra/wsl.js";
@@ -464,14 +464,3 @@ export function resolveControlUiLinks(params: {
wsUrl: `ws://${host}:${port}${wsPath}`,
};
}
function isValidIPv4(host: string): boolean {
const parts = host.split(".");
if (parts.length !== 4) {
return false;
}
return parts.every((part) => {
const n = Number.parseInt(part, 10);
return !Number.isNaN(n) && n >= 0 && n <= 255 && part === String(n);
});
}