Hacker News new | past | comments | ask | show | jobs | submit login

Seems like pretty trivial bikeshedding. How about just:

    const user = await db.findOne()
    if (user) ... else ...
Typescript can even narrow the type to null vs. User in each branch block.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: