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

Function defaultTextProcessor

packages/effect/src/unstable/cli/Prompt.ts:3656–3666  ·  view source on GitHub ↗
(input: string, state: TextState)

Source from the content-addressed store, hash-verified

3654}
3655
3656const defaultTextProcessor = (input: string, state: TextState) => {
3657 const beforeCursor = state.value.slice(0, state.cursor)
3658 const afterCursor = state.value.slice(state.cursor)
3659 const value = `${beforeCursor}${input}${afterCursor}`
3660 const cursor = state.cursor + input.length
3661 return Effect.succeed(
3662 Action.NextFrame({
3663 state: { ...state, cursor, value, error: Option.none() }
3664 })
3665 )
3666}
3667
3668const handleTextRender = (options: TextOptionsReq) => {
3669 return (state: TextState, action: Action<TextState, string>) => {

Callers 1

handleTextProcessFunction · 0.85

Calls 1

succeedMethod · 0.45

Tested by

no test coverage detected