(json: string)
| 579 | const raise: EffectFactory<Raise> = effect("raise", { resumable: false }); |
| 580 | |
| 581 | const parseJSON = <T>(json: string): Effected<SyntaxError | Raise, T> => |
| 582 | effected(function* () { |
| 583 | try { |
| 584 | return JSON.parse(json); |
| 585 | } catch (e) { |
| 586 | if (e instanceof SyntaxError) return yield* syntaxError(e.message); |
| 587 | return yield* raise(e); |
| 588 | } |
| 589 | }); |
| 590 | |
| 591 | interface Settings { |
| 592 | something: string; |
no test coverage detected