mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 17:26:24 +00:00
fix(quality): resolve reliability findings on dev
The Sonar quality gate rated new code D. Preserve focus and keyboard interaction through native controls and shared dialog behavior. Replace ambiguous regex scans with bounded parsing and make numeric coercion and initialization explicit.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { stripTrailingSlashes } from '@trek/shared';
|
||||
import { detectAuthGate, type AuthGate } from './authGate';
|
||||
import { DEMO_SERVER_URL } from './links';
|
||||
|
||||
@@ -59,7 +60,7 @@ function normalize(raw: string): string | null {
|
||||
return null;
|
||||
}
|
||||
if ((parsed.protocol !== 'https:' && parsed.protocol !== 'http:') || !parsed.hostname) return null;
|
||||
return parsed.origin + parsed.pathname.replace(/\/+$/, '');
|
||||
return parsed.origin + stripTrailingSlashes(parsed.pathname);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user