MCPcopy Create free account
hub / github.com/anomalyco/opencode / sortModelOptions

Function sortModelOptions

packages/tui/src/component/dialog-model.tsx:186–197  ·  view source on GitHub ↗
(
  options: T[],
  newestFirst: boolean,
)

Source from the content-addressed store, hash-verified

184}
185
186export function sortModelOptions<T extends { footer?: string; releaseDate: string | number; title: string }>(
187 options: T[],
188 newestFirst: boolean,
189) {
190 if (newestFirst) return sortBy(options, [(option) => option.releaseDate, "desc"], (option) => option.title)
191 return sortBy(
192 options,
193 (option) => option.footer !== "Free",
194 [(option) => option.releaseDate, "desc"],
195 (option) => option.title,
196 )
197}

Callers 2

DialogModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected