if (ack.err) throw new Error(ack.err) throws
Property 'err' does not exist on type 'GunMessagePut'. Property 'err' does not exist on type '{ ok: { '': 1; }; }'.ts(2339)
The callback would probably be better typed as
export type GunMessagePut =
| {
/** if there was an error during save */
err: string
}
& {
/** if there was a success message (none is required though) */
ok: { '': 1 }
}
export type GunCallbackPut = (ack: GunMessagePut) => void
if (ack.err) throw new Error(ack.err)
throwsProperty 'err' does not exist on type 'GunMessagePut'. Property 'err' does not exist on type '{ ok: { '': 1; }; }'.ts(2339)
The callback would probably be better typed as
unless it's an error on my end?