Hey everyone 👋 I’m @nyaomaru, a frontend engineer who stays warm every day by practicing sumo squats 🥶💪

Have you ever written complex TypeScript code where type guards get tangled up inside a forest of nested if statements?

Today, let’s explore how to escape that forest by composing type guards logically with the open-source library is-kit.

Let’s dive in together!

🧠 The Philosophy of and, or, and not

is-kit provides composable logical operators for type guards:

  • and: all conditions must be true (intersection)
  • or: at least one condition must be true (union)
  • not: negates a condition (negation)

These operators keep both runtime checks and TypeScript narrowing intact. In other words, they t…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help