oh-my-opencode/src/shared/model-normalization.ts
IYODA Atsushi 4b366926d4 refactor(shared): deduplicate model resolution utility functions
Extract normalizeModel() (3 identical copies) and normalizeModelID()
(2 identical copies) into canonical src/shared/model-normalization.ts.
Delete dead-end duplicate model-name-matcher.ts. Update all consumers.
2026-03-02 16:38:22 +09:00

9 lines
237 B
TypeScript

export function normalizeModel(model?: string): string | undefined {
const trimmed = model?.trim()
return trimmed || undefined
}
export function normalizeModelID(modelID: string): string {
return modelID.replace(/\.(\d+)/g, "-$1")
}