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

Function fitVariant

packages/opencode/src/cli/cmd/run/variant.shared.ts:82–92  ·  view source on GitHub ↗
(value: string | undefined, variants: string[])

Source from the content-addressed store, hash-verified

80}
81
82function fitVariant(value: string | undefined, variants: string[]): string | undefined {
83 if (!value) {
84 return undefined
85 }
86
87 if (variants.length === 0 || variants.includes(value)) {
88 return value
89 }
90
91 return undefined
92}
93
94// Picks the active variant. CLI flag wins, then saved preference, then session
95// history. fitVariant() checks saved and session values against the available

Callers 1

resolveVariantFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected