MCPcopy
hub / github.com/Fission-AI/OpenSpec / validateConfig

Function validateConfig

src/core/config-schema.ts:265–277  ·  view source on GitHub ↗
(config: unknown)

Source from the content-addressed store, hash-verified

263 * @returns Validation result with success status and optional error message
264 */
265export function validateConfig(config: unknown): { success: boolean; error?: string } {
266 try {
267 GlobalConfigSchema.parse(config);
268 return { success: true };
269 } catch (error) {
270 if (error instanceof z.ZodError) {
271 const zodError = error as z.ZodError;
272 const messages = zodError.issues.map((e) => `${e.path.join('.')}: ${e.message}`);
273 return { success: false, error: messages.join('; ') };
274 }
275 return { success: false, error: 'Unknown validation error' };
276 }
277}

Callers 3

config.test.tsFile · 0.85
registerConfigCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected