(state: State, input: string)
| 155 | } |
| 156 | |
| 157 | function 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 | |
| 172 | function defaultFloatProcessor( |
| 173 | state: State, |
no test coverage detected