mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
feat: surface validation feedback in playground UI
This commit is contained in:
parent
1ad8efb658
commit
15962d205f
4 changed files with 63 additions and 5 deletions
|
|
@ -12,3 +12,13 @@ export function tryGetHostname(url: string): string | undefined {
|
|||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/** True when the value parses as an http(s) URL — mirrors the backend's boundary rule. */
|
||||
export function isHttpUrl(value: string): boolean {
|
||||
try {
|
||||
const { protocol } = new URL(value);
|
||||
return protocol === "http:" || protocol === "https:";
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue