(value: string | undefined)
| 46 | } |
| 47 | |
| 48 | export 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 | } |
no outgoing calls
no test coverage detected