Files
TREK/shared/src/common/strip-trailing-slashes.ts
T
Maurice e539860530 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.
2026-12-01 21:06:05 +01:00

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);
}