Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatdeveloperguy-website / src/engines/seo/urls/normalize-path.ts |
| Date | Not specified in source |
| Repository | Janady13/thatdeveloperguy-website |
| Revision | 2bea2ebdff0e34494bff597d4fa9c8422a0c3a94 |
| Branch | main |
| Path or archive member | src/engines/seo/urls/normalize-path.ts |
| Original SHA-256 | 7b5de4144054cc80486df9dae0cb41e678c7330aa64489c8067063608cb1b0c6 |
| Git blob SHA | 5f90cb77a105c2edfc20c8848453d25cb891d038 |
| Reading-copy SHA-256 | 7b5de4144054cc80486df9dae0cb41e678c7330aa64489c8067063608cb1b0c6 |
Recovered source transcript
Download complete source text ↓6 lines · 0.2 KB
/** Trailing-slash policy: no trailing slash except the root. */
export function normalizePath(path: string): string {
const stripped = path.replace(/\/+$/, '');
return stripped === '' ? '/' : stripped;
}