bpms_site/.svn/pristine/83/83a61fe4ccae4a5b2659e3ce3488ef8b49706b35.svn-base
2025-11-02 16:38:49 +03:30

11 lines
332 B
Plaintext

/**
* Removes the trailing slash for a given route or page path. Preserves the
* root page. Examples:
* - `/foo/bar/` -> `/foo/bar`
* - `/foo/bar` -> `/foo/bar`
* - `/` -> `/`
*/ export function removeTrailingSlash(route) {
return route.replace(/\/$/, "") || "/";
}
//# sourceMappingURL=remove-trailing-slash.js.map