MCPcopy Create free account
hub / github.com/Effect-TS/effect / processSelectCursorDown

Function processSelectCursorDown

packages/effect/src/unstable/cli/Prompt.ts:3300–3305  ·  view source on GitHub ↗
(state: SelectState, choices: SelectOptionsReq<A>["choices"])

Source from the content-addressed store, hash-verified

3298}
3299
3300const processSelectCursorDown = <A>(state: SelectState, choices: SelectOptionsReq<A>["choices"]) => {
3301 if (state === choices.length - 1) {
3302 return Effect.succeed(Action.NextFrame({ state: 0 }))
3303 }
3304 return Effect.succeed(Action.NextFrame({ state: state + 1 }))
3305}
3306
3307const processSelectNext = <A>(state: SelectState, choices: SelectOptionsReq<A>["choices"]) => {
3308 return Effect.succeed(Action.NextFrame({ state: (state + 1) % choices.length }))

Callers 1

handleSelectProcessFunction · 0.85

Calls 1

succeedMethod · 0.45

Tested by

no test coverage detected