(scope: ArchiveScopeInfo)
| 52 | } |
| 53 | |
| 54 | function getScopeBasePath(scope: ArchiveScopeInfo): string { |
| 55 | if (scope.scopeType === ArchiveScopeType.Global) { |
| 56 | return '/posts/best-of'; |
| 57 | } |
| 58 | |
| 59 | if (scope.scopeType === ArchiveScopeType.Tag) { |
| 60 | return `/tags/${encodeURIComponent(scope.scopeId)}/best-of`; |
| 61 | } |
| 62 | |
| 63 | return `/sources/${encodeURIComponent(scope.scopeId)}/best-of`; |
| 64 | } |
| 65 | |
| 66 | export function getArchiveIndexUrl(scope: ArchiveScopeInfo): string { |
| 67 | return getScopeBasePath(scope); |
no outgoing calls
no test coverage detected