MCPcopy
hub / github.com/github/docs / useVersion

Function useVersion

components/hooks/useVersion.ts:9–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7}
8export const DEFAULT_VERSION = 'free-pro-team@latest'
9export const useVersion = (): VersionInfo => {
10 const router = useRouter()
11 const currentVersion = (router.query.versionId as string) || DEFAULT_VERSION
12 return {
13 currentVersion,
14 isEnterprise: currentVersion.includes('enterprise'),
15 isEnterpriseServer: currentVersion.includes('enterprise-server'),
16 }
17}

Callers 15

RestRedirectFunction · 0.90
SearchFunction · 0.90
RestBannerFunction · 0.90
HeaderNotificationsFunction · 0.90
VersionPickerFunction · 0.90
HeaderFunction · 0.90
DeprecationBannerFunction · 0.90
ProductSelectionCardFunction · 0.90
getShellExampleFunction · 0.90
SearchFunction · 0.90
SidebarHomepageFunction · 0.90
ApiVersionPickerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected