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

Function processTab

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

Source from the content-addressed store, hash-verified

3906 )
3907
3908const processTab = (state: TextState, options: TextOptionsReq) => {
3909 if (state.value === options.default) {
3910 return Effect.succeed(Action.Beep())
3911 }
3912 const value = state.value.length === 0 ? options.default : state.value
3913 return Effect.succeed(
3914 Action.NextFrame({
3915 state: { ...state, value, cursor: value.length, error: Option.none() }
3916 })
3917 )
3918}
3919
3920const defaultTextProcessor = (input: string, state: TextState) => {
3921 const beforeCursor = state.value.slice(0, state.cursor)

Callers 1

handleTextProcessFunction · 0.85

Calls 1

succeedMethod · 0.45

Tested by

no test coverage detected