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

Function processTab

packages/effect/src/unstable/cli/Prompt.ts:3644–3654  ·  view source on GitHub ↗
(state: TextState, options: TextOptionsReq)

Source from the content-addressed store, hash-verified

3642 )
3643
3644const processTab = (state: TextState, options: TextOptionsReq) => {
3645 if (state.value === options.default) {
3646 return Effect.succeed(Action.Beep())
3647 }
3648 const value = state.value.length === 0 ? options.default : state.value
3649 return Effect.succeed(
3650 Action.NextFrame({
3651 state: { ...state, value, cursor: value.length, error: Option.none() }
3652 })
3653 )
3654}
3655
3656const defaultTextProcessor = (input: string, state: TextState) => {
3657 const beforeCursor = state.value.slice(0, state.cursor)

Callers 1

handleTextProcessFunction · 0.85

Calls 1

succeedMethod · 0.45

Tested by

no test coverage detected