mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 19:10:39 +00:00
13 lines
337 B
TypeScript
13 lines
337 B
TypeScript
export function resolveRequestUrl(input: RequestInfo | URL): string {
|
|
if (typeof input === "string") {
|
|
return input;
|
|
}
|
|
if (input instanceof URL) {
|
|
return input.toString();
|
|
}
|
|
if (typeof input === "object" && input && "url" in input && typeof input.url === "string") {
|
|
return input.url;
|
|
}
|
|
return String(input);
|
|
}
|