MCPcopy Index your code
hub / github.com/callstack/agent-device / parsePermissionTarget

Function parsePermissionTarget

src/platforms/permission-utils.ts:48–71  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

46}
47
48export function parsePermissionTarget(value: string | undefined): PermissionTarget {
49 const normalized = value?.trim().toLowerCase();
50 if (
51 normalized === 'camera' ||
52 normalized === 'microphone' ||
53 normalized === 'photos' ||
54 normalized === 'contacts' ||
55 normalized === 'contacts-limited' ||
56 normalized === 'notifications' ||
57 normalized === 'calendar' ||
58 normalized === 'location' ||
59 normalized === 'location-always' ||
60 normalized === 'media-library' ||
61 normalized === 'motion' ||
62 normalized === 'reminders' ||
63 normalized === 'siri'
64 ) {
65 return normalized;
66 }
67 throw new AppError(
68 'INVALID_ARGS',
69 `permission setting requires a target: ${PERMISSION_TARGETS.join('|')}`,
70 );
71}

Callers 2

parseIosPermissionTargetFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected