Skip to content

A comprehensive collection of type-guards, type assertions and related utils

License

Notifications You must be signed in to change notification settings

Goldziher/type-predicates

Folders and files

NameName
Last commit message
Last commit date
Feb 9, 2024
Jun 29, 2023
Sep 15, 2023
Dec 11, 2023
Sep 15, 2023
Dec 3, 2021
Dec 7, 2022
Aug 5, 2021
Jun 29, 2023
Jul 31, 2021
Sep 15, 2023
May 2, 2022
Dec 11, 2023
Dec 11, 2023
Sep 15, 2023
Sep 15, 2023
Sep 15, 2023
Jun 29, 2023
Dec 11, 2023

Repository files navigation

Coverage Security Rating Reliability Rating Maintainability Rating

@tool-belt/type-predicates

Installation

npm install @tool-belt/type-predicates

Contents

This package includes the following:

  • a comprehensive collection of performant and flexible type-guards, that can function as a drop-in replacement for the type-guards included in the NodeJS builtin utils/types module - with better significantly typing.
  • a comprehensive collection of type assertions covering all type-guards included in the package.
  • isUnion, createTypeGuard and createTypeAssertion utilities for the composition of type-guards and assertions.
  • supports ES modules and tree shaking, i.e., works great with module bundlers such as Webpack for the browser.

See the docs for details.