MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / normalizeActiveProfile

Function normalizeActiveProfile

src/hooks/profilesStorage.ts:18–22  ·  view source on GitHub ↗
(activeProfile: unknown, profiles: ProfilesData['profiles'])

Source from the content-addressed store, hash-verified

16}
17
18function normalizeActiveProfile(activeProfile: unknown, profiles: ProfilesData['profiles']): string | null {
19 if (typeof activeProfile !== 'string') return null;
20 if (activeProfile === DEFAULT_PROFILE_NAME || activeProfile in profiles) return activeProfile;
21 return null;
22}
23
24export function normalizeProfilesData(value: unknown): ProfilesData {
25 if (!isRecord(value) || !isRecord(value.profiles)) {

Callers 2

normalizeProfilesDataFunction · 0.85
serializeProfilesDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected