Skip to content

StrictExtract

Extract types in `T` that are assignable to `U`. Coerce `any` and `never` types to unknown.

Usage

StrictExtract<string | number | boolean, string>; // ^? string

Installation

Terminal window
npx atmx add type strict-extract