mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 17:26:24 +00:00
e539860530
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.
7 lines
238 B
TypeScript
7 lines
238 B
TypeScript
/** Remove every trailing slash from a URL or path in one pass. */
|
|
export function stripTrailingSlashes(value: string): string {
|
|
let end = value.length;
|
|
while (end > 0 && value[end - 1] === '/') end--;
|
|
return value.slice(0, end);
|
|
}
|