import { decide } from '../../src/index.js' import { input } from './input.js' const result = await decide(input) .onSuccess((answers) => ({ ok: true as const, answers })) .onError({ type: 'invalid-input' }, (error) => ({ ok: false as const, error })) .onError({ type: 'input-too-long' }, (error) => ({ ok: false as const, error })) console.log(JSON.stringify(result, null, 2))