Overview
Protocol type guards check whether a value implements a specific JavaScript protocol. These helpers validate behavior rather than structure, returning simple booleans with no side effects.
- isAsyncIterable: Checks whether a value implements the async iteration protocol (
Symbol.asyncIterator). - isCallable: Checks whether a value can be safely invoked as a function and is not an ES2015 class constructor.
- isIterable: Checks whether a value implements the iteration protocol (
Symbol.iterator). - isPromise: Checks whether a value is a
Promiseor promise‑like object. - isThenable: Checks whether a value implements the minimal thenable protocol by exposing a callable
thenmethod.
All protocol guards are pure, predictable, and safe to use before normalization or validation.