MCPcopy Index your code
hub / github.com/anomalyco/opencode / questionToggle

Function questionToggle

packages/opencode/src/cli/cmd/run/question.shared.ts:195–205  ·  view source on GitHub ↗
(state: QuestionBodyState, answer: string)

Source from the content-addressed store, hash-verified

193}
194
195function questionToggle(state: QuestionBodyState, answer: string): QuestionBodyState {
196 const list = [...(state.answers[state.tab] ?? [])]
197 const idx = list.indexOf(answer)
198 if (idx === -1) {
199 list.push(answer)
200 } else {
201 list.splice(idx, 1)
202 }
203
204 return storeAnswers(state, state.tab, list)
205}
206
207export function questionMove(state: QuestionBodyState, request: QuestionRequest, dir: -1 | 1): QuestionBodyState {
208 const total = questionTotal(request, state)

Callers 1

questionSelectFunction · 0.85

Calls 2

storeAnswersFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected