mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(ci): address lint and test type failures
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user