Registry / type-stubs / type-plus

type-plus

JSON →
library7.6.2jsnpmunverified

Type utility library providing over 100 advanced TypeScript types for type-level programming. Current stable version is 7.6.2, released on npm with a moderate release cadence. It offers a wide range of type utilities such as numeric operations, object manipulation, array utilities, logical types, and assertion helpers. Key differentiators include a comprehensive set of type-level functions, support for advanced types like `$Equal`, `$Exact`, `Distributive`, and `AdjustExactOptionalProps`, along with built-in support for ESM and CJS. The library is actively maintained with a beta for v8.0.0 introducing breaking changes like renaming of types and ESM-only mode.

npm install type-plus
INSTALL
IMPORT
SIG · TYPE-PLUS
T
type-plus
type-stubsjavascriptv7.6.2
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IsAny
✓ import { IsAny } from 'type-plus'
✗ import { IsAny } from 'type-plus/esm'
Package supports ESM and CJS; top-level import works for both.
type-plus
✓ import * as tp from 'type-plus'
Namespace import to avoid name conflicts.
Equal
✓ import { Equal } from 'type-plus'
✗ import { $Equal } from 'type-plus'
In v7.x, use `Equal`; v8.0.0 renames to `$Equal`.

Demonstrates basic type-level type guards and array reversal using type-plus in TypeScript.

import { IsAny, IsNever, IsLiteral, IsUnion, Exact, A } from 'type-plus' // Check types at the type level type CheckAny = IsAny<any> // true type CheckNever = IsNever<never> // true type CheckLiteral = IsLiteral<'hello'> // true type CheckUnion = IsUnion<string | number> // true // Exact type comparison type ExactCheck = Exact<{ a: 1 }, { a: 1 }> // true type ExactMismatch = Exact<{ a: 1 }, { a: 2 }> // false // Array utilities type Reversed = A.Reverse<[1, 2, 3]> // [3, 2, 1]
Debug
Known issues
breakingv8.0.0 renames many types: e.g., `Equal` to `$Equal`, `case*` to `$*`, `Exact` options restructured.
fix
Upgrade migration: replace old names with new ones (see changelog).
affects: ^8.0.0
deprecated`NoInfer` and `Failed` types are deprecated in v8.0.0-beta.
fix
Remove usage or use alternative types recommended in documentation.
affects: ^8.0.0
gotchaIncorrect usage of `typesVersions` in package.json caused resolution issues in v8.0.0-beta.5.
fix
Update to version 8.0.0-beta.6 or later.
affects: 8.0.0-beta.5
gotchaTypeScript 5.4+ required from v8.0.0-beta.2 onward; earlier versions may fail to load types.
fix
Ensure TypeScript version is >=5.4.
affects: >=8.0.0-beta.2
gotchaExcessive stack depth errors for some types like `Zeros` in earlier versions.
fix
Upgrade to v7.6.2 or later for fix.
affects: <7.6.2
Errors
Common errors & fixes
Excessive stack depth comparing types
Complex recursive types like `Zeros` cause TypeScript to exceed stack depth.
fix
Upgrade to type-plus@7.6.2+ or avoid using problematic types with deeply nested generics.
Cannot find module 'type-plus' or its corresponding type declarations
Missing or incorrect TypeScript version (<5.4) or package not installed.
fix
Install package: npm install type-plus@latest. Ensure TypeScript >=5.4 for v8.0.0+.
Property 'IsAny' does not exist on type 'typeof import("type-plus")'
Incorrect import style: using `require` or wrong path.
fix
Use proper ES import: `import { IsAny } from 'type-plus'`.
Upgrade
Version history
7.6.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
type-plus — npm install type-plus · libregistry