MCPcopy
hub / github.com/codeaashu/claude-code / parseSettingSourcesFlag

Function parseSettingSourcesFlag

src/utils/settings/constants.ts:128–153  ·  view source on GitHub ↗
(flag: string)

Source from the content-addressed store, hash-verified

126 * @returns Array of SettingSource values
127 */
128export function parseSettingSourcesFlag(flag: string): SettingSource[] {
129 if (flag === '') return []
130
131 const names = flag.split(',').map(s => s.trim())
132 const result: SettingSource[] = []
133
134 for (const name of names) {
135 switch (name) {
136 case 'user':
137 result.push('userSettings')
138 break
139 case 'project':
140 result.push('projectSettings')
141 break
142 case 'local':
143 result.push('localSettings')
144 break
145 default:
146 throw new Error(
147 `Invalid setting source: ${name}. Valid options are: user, project, local`,
148 )
149 }
150 }
151
152 return result
153}
154
155/**
156 * Get enabled setting sources with policy/flag always included

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected