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

Function defaultTextProcessor

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

Source from the content-addressed store, hash-verified

3918}
3919
3920const defaultTextProcessor = (input: string, state: TextState) => {
3921 const beforeCursor = state.value.slice(0, state.cursor)
3922 const afterCursor = state.value.slice(state.cursor)
3923 const value = `${beforeCursor}${input}${afterCursor}`
3924 const cursor = state.cursor + input.length
3925 return Effect.succeed(
3926 Action.NextFrame({
3927 state: { ...state, cursor, value, error: Option.none() }
3928 })
3929 )
3930}
3931
3932const handleTextRender = (options: TextOptionsReq) => {
3933 return (state: TextState, action: Action<TextState, string>) => {

Callers 1

handleTextProcessFunction · 0.85

Calls 2

sliceMethod · 0.80
succeedMethod · 0.45

Tested by

no test coverage detected