fix(ci): address lint and test type failures

This commit is contained in:
Peter Steinberger
2026-05-27 15:56:04 -04:00
parent 60e8e60306
commit c71c49c460
3 changed files with 11 additions and 3 deletions

View File

@@ -272,7 +272,7 @@ export const ircSetupWizard: ChannelSetupWizard = {
},
validate: ({ value }) => {
const raw = normalizeStringifiedOptionalString(value) ?? "";
const parsed = /^\+?\d+$/.test(raw.trim()) ? Number(raw.trim()) : NaN;
const parsed = /^\+?\d+$/.test(raw.trim()) ? Number(raw.trim()) : Number.NaN;
return Number.isSafeInteger(parsed) && parsed >= 1 && parsed <= 65535
? undefined
: "Use a port between 1 and 65535";

View File

@@ -313,7 +313,11 @@ function normalizeWatchIntervalMs(value: string | number | undefined): number {
return 2000;
}
const raw =
typeof value === "number" ? value : /^\+?\d+$/.test(value.trim()) ? Number(value.trim()) : NaN;
typeof value === "number"
? value
: /^\+?\d+$/.test(value.trim())
? Number(value.trim())
: Number.NaN;
if (!Number.isSafeInteger(raw) || raw < 250) {
throw new Error("--interval-ms must be an integer >= 250.");
}

View File

@@ -598,10 +598,14 @@ function installFastLocalImageProviderStubs(...providers: MediaUnderstandingProv
}),
loadImageWebMediaRuntime: async () => ({
loadWebMedia: async (mediaUrl, options) => {
const inboundRoots =
options && typeof options === "object" && "inboundRoots" in options
? options.inboundRoots
: [];
if (
!isInboundPathAllowed({
filePath: mediaUrl,
roots: options?.inboundRoots ?? [],
roots: inboundRoots ?? [],
})
) {
throw new Error(`Local media path is not under an allowed directory: ${mediaUrl}`);