How sindresorhus/is works
@sindresorhus/is is a TypeScript runtime utility for detecting value types, checking predicates, and asserting types with TypeScript narrowing. A caller supplies a value to the exported API and receives a type name, boolean result, or an exception on failed assertion. The README documents broad predicate families, composable array checks, and assertions; these are implemented within the large source/index.ts module. source/types.ts supplies type definitions and source/utilities.ts supplies a key helper. The graph reflects documented capabilities; it does not imply separate runtime stages where the implementation is not shown.
Main entry points: index.ts Type detection · types.ts Type definitions · utilities.ts Key helper
Components 9
Type-check API
- Type detection
source/index.ts - Type guards
source/index.ts - Type assertions
source/index.ts - Collection checks
source/index.ts - Emptiness checks
source/index.ts - Special checks
source/index.ts
TypeScript support
- Type definitions
source/types.ts
Internal helper
- Key helper
source/utilities.ts
Other components
- Library caller
Connections 8
- Library caller → Type detection: detects type
readme.md - Library caller → Type guards: checks value
readme.md - Library caller → Type assertions: asserts type
readme.md - Library caller → Collection checks: checks collections
readme.md - Library caller → Emptiness checks: checks emptiness
readme.md - Library caller → Special checks: checks value
readme.md - Type detection → Key helper: uses keysOf
source/index.ts - Type detection → Type definitions: imports types
source/index.ts