( updates: PermissionUpdate[] | undefined, )
| 28 | export type { AdditionalWorkingDirectory, WorkingDirectorySource } |
| 29 | |
| 30 | export function extractRules( |
| 31 | updates: PermissionUpdate[] | undefined, |
| 32 | ): PermissionRuleValue[] { |
| 33 | if (!updates) return [] |
| 34 | |
| 35 | return updates.flatMap(update => { |
| 36 | switch (update.type) { |
| 37 | case 'addRules': |
| 38 | return update.rules |
| 39 | default: |
| 40 | return [] |
| 41 | } |
| 42 | }) |
| 43 | } |
| 44 | |
| 45 | export function hasRules(updates: PermissionUpdate[] | undefined): boolean { |
| 46 | return extractRules(updates).length > 0 |
no outgoing calls
no test coverage detected