MCPcopy Index your code
hub / github.com/Effect-TS/effect / defaultIntProcessor

Function defaultIntProcessor

packages/cli/src/internal/prompt/number.ts:157–170  ·  view source on GitHub ↗
(state: State, input: string)

Source from the content-addressed store, hash-verified

155}
156
157function defaultIntProcessor(state: State, input: string) {
158 if (state.value.length === 0 && input === "-") {
159 return Effect.succeed(Action.NextFrame({
160 state: { ...state, value: "-", error: Option.none() }
161 }))
162 }
163 return Effect.match(parseInt(state.value + input), {
164 onFailure: () => Action.Beep(),
165 onSuccess: (value) =>
166 Action.NextFrame({
167 state: { ...state, value: `${value}`, error: Option.none() }
168 })
169 })
170}
171
172function defaultFloatProcessor(
173 state: State,

Callers 1

handleProcessIntegerFunction · 0.85

Calls 1

parseIntFunction · 0.85

Tested by

no test coverage detected