mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
chore(repo): prune dead code and duplicate abstractions (#3413)
This commit is contained in:
1 parent
c17091768c
commit
c9fdf8fead
2937 files changed
+42233
-176793
No files matched your search
@@ -103,3 +103,17 @@ export function slugifyHeading(heading: string): string {
|
||||
.trim()
|
||||
.replace(/\s+/gu, '-');
|
||||
}
|
||||
|
||||
export function stripVersion(routePath: string): string {
|
||||
if (routePath.startsWith('/v1/')) {
|
||||
return routePath.slice(3);
|
||||
}
|
||||
return routePath;
|
||||
}
|
||||
|
||||
export function pageSlug(relativePath: string): string {
|
||||
return relativePath
|
||||
.replace(/\.(mdx|md)$/u, '')
|
||||
.replace(/\/index$/u, '')
|
||||
.replace(/^index$/u, '');
|
||||
}
|
||||
Reference in new issue
Block a user