Signature
- Namespace
- Class
Parameters
- value - Value to check (any type)
Returns
boolean - true if value is CallData instance (with type narrowing)
Examples
- Basic Usage
- Type Narrowing
- Array Filtering
Type Narrowing
TypeScript narrows the type whenis() returns true:
Comparison with isValid
- is() - Type Guard
- isValid() - Validation
value is CallDataType)
Use for: Type narrowing, checking existing instancesUse Cases
Function Overloads
Union Type Handling
Generic Functions
Type-Safe Caching
Implementation
Checks for CallData brand:- Is Uint8Array
- Has CallData brand
- Minimum 4 bytes (selector)
Performance
Very fast (just property checks):Type Safety Example
Branded Type Pattern
CallData uses Symbol branding for type safety:Related
- isValid - Validate input can be converted
- from - Universal constructor
- Branded Types - Understanding branding
- equals - Compare CallData instances

