Simplify back to ternary now that typecast is gone

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-03-17 09:28:38 -07:00
parent 356b8ea0d6
commit d2a3f7a669

View File

@@ -146,10 +146,7 @@ export function duplicateModel<M extends AnyModel["model"], T extends ExtractMod
// If the model has an explicit (non-empty) name, try to duplicate it with a name that doesn't conflict.
// When the name is empty, keep it empty so the display falls back to the URL.
let name: string | undefined;
if ("name" in model) {
name = model.name;
}
let name = "name" in model ? model.name : undefined;
if (name) {
const existingModels = listModels(model.model);
for (let i = 0; i < 100; i++) {