eres
eres copied to clipboard
Allow option to return an empty object on error
Instead of this:
const [e, res] = await eres(dnsLookup(domain))
if (e) throw e
const {address, family} = res
You could do this:
const [e, {address, family}] = await eres(dnsLookup(domain), {returnObject: true})
if (e) throw e
Or maybe something like:
eres.obj(dnsLookup(domain))
Otherwise its trying to destructure a null when there is an error.
What are your thoughts?