mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 20:50:20 +00:00
refactor: dedupe trim string helpers
This commit is contained in:
@@ -4,6 +4,7 @@ import { SsrFBlockedError, type LookupFn } from "../../infra/net/ssrf.js";
|
||||
import { logDebug } from "../../logger.js";
|
||||
import type { RuntimeWebFetchMetadata } from "../../secrets/runtime-web-tools.types.js";
|
||||
import { wrapExternalContent, wrapWebContent } from "../../security/external-content.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { isRecord } from "../../utils.js";
|
||||
import { resolveWebFetchDefinition } from "../../web-fetch/runtime.js";
|
||||
import { resolveWebProviderConfig } from "../../web/provider-runtime-shared.js";
|
||||
@@ -247,10 +248,7 @@ type WebFetchRuntimeParams = {
|
||||
};
|
||||
|
||||
function normalizeProviderFinalUrl(value: unknown): string | undefined {
|
||||
if (typeof value !== "string") {
|
||||
return undefined;
|
||||
}
|
||||
const trimmed = value.trim();
|
||||
const trimmed = normalizeOptionalString(value);
|
||||
if (!trimmed) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user