Darragh ORiordan

  • About
  • Articles
  • Projects
  • Hire

Stay up to date

Subscribe to the newsletter to stay up to date with articles, news and much more!

Read the Privacy Policy.

Socials & Contact

  • Follow on Twitter
  • Follow on GitHub
  • Follow on LinkedIn
  • mailto:[email protected]

Sitemap

AboutArticlesProjectsHire

© 2026 Darragh ORiordan. All rights reserved.

Create an only ever true boolean type in typescript

  • #typescript
Photo by Cookie the Pom on UnsplashApril 8, 2021

Integrating with an API where a boolean can only be undefined or true I needed to type it. It's easy enough but I just wanted to jot it down in case any one else needs this in the future.

// create the required type
type OnlyEverTrue = true | undefined;

// and then to use it
{
  property: OnlyEverTrue;
}

Hey! Are you a developer?

🚀 Set Up Your Dev Environment in Minutes, Not Hours!

Tired of spending hours setting up a new development machine? I used to be, too—until I automated the entire process!

Now, I just run a single script, grab a coffee, and let my setup take care of itself.

Save 30+ hours configuring a new Mac or Windows (WSL) development environment.
Ensure consistency across all your machines.
Eliminate tedious setup and get coding faster!
Get Instant Access →