Browse Source

Simplify tool string splitting in ai-config command

Refactored the splitting of the 'tool' option to use a single regex for whitespace and commas, removing the need for an explicit trim(). This streamlines parsing and improves code clarity.
pull/23910/head
Fahri Gedik 3 months ago
parent
commit
12fa8bcae9
  1. 3
      npm/ng-packs/packages/schematics/src/commands/ai-config/index.ts

3
npm/ng-packs/packages/schematics/src/commands/ai-config/index.ts

@ -17,8 +17,7 @@ export default function (options: AiConfigSchema): Rule {
}
const tools = options.tool
.split(/[,\s]+/)
.map(t => t.trim())
.split(/[\s,]+/)
.filter(t => t) as AiTool[];
const validTools: AiTool[] = ['claude', 'copilot', 'cursor', 'gemini', 'junie', 'windsurf'];

Loading…
Cancel
Save