MCPcopy Index your code
hub / github.com/codeaashu/claude-code / extractRules

Function extractRules

src/utils/permissions/PermissionUpdate.ts:30–43  ·  view source on GitHub ↗
(
  updates: PermissionUpdate[] | undefined,
)

Source from the content-addressed store, hash-verified

28export type { AdditionalWorkingDirectory, WorkingDirectorySource }
29
30export 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
45export function hasRules(updates: PermissionUpdate[] | undefined): boolean {
46 return extractRules(updates).length > 0

Callers 7

bashToolHasPermissionFunction · 0.85
SuggestedRulesFunction · 0.85
SuggestionDisplayFunction · 0.85
permissionResultToLogFunction · 0.85
hasRulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected