MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / normalizeCustomWorkflows

Function normalizeCustomWorkflows

src/utils/project-config.ts:176–205  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

174}
175
176function normalizeCustomWorkflows(value: unknown): Record<string, string[]> {
177 if (!isPlainObject(value)) {
178 return {};
179 }
180
181 const normalized: Record<string, string[]> = {};
182
183 for (const [workflowName, workflowTools] of Object.entries(value)) {
184 const normalizedWorkflowName = workflowName.trim().toLowerCase();
185 if (!normalizedWorkflowName) {
186 continue;
187 }
188 if (Array.isArray(workflowTools)) {
189 normalized[normalizedWorkflowName] = workflowTools
190 .filter((toolName): toolName is string => typeof toolName === 'string')
191 .map((toolName) => toolName.trim().toLowerCase())
192 .filter(Boolean);
193 continue;
194 }
195 if (typeof workflowTools === 'string') {
196 normalized[normalizedWorkflowName] = workflowTools
197 .split(',')
198 .map((toolName) => toolName.trim().toLowerCase())
199 .filter(Boolean);
200 continue;
201 }
202 }
203
204 return normalized;
205}
206
207function resolveRelativeTopLevelPaths(config: ProjectConfig, cwd: string): ProjectConfig {
208 const resolved: ProjectConfig = { ...config };

Callers 2

loadProjectConfigFunction · 0.85

Calls 1

isPlainObjectFunction · 0.85

Tested by

no test coverage detected