New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

typect

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typect

Type-Level Testing Framework

latest
npmnpm
Version
0.0.4
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Typect

Documentation is currently being written.
The API may change during development as it is still actively being developed.

Typect is Type-Level Testing Framework based HKT (Higher Kinded Type).
I believe the TypeScript compiler is the best test runner. (Just kidding)

Typect means "type" + "expect".

Install

npm add --save-dev typect
yarn add -D typect
pnpm add -D typect

Example

Load the full matchers

// Load the full matchers
import { Expect, _ } from "typect"

// Load specific matchers
import { 
  Expect,
  ToBeLessThan,
  Not,
  Returns,
} from "typect"

// with specific matchers
Expect<1, ToBeLessThan<2>>
Expect<{ a: 1 }, Not.ToMatch<{ b: 1 }>>
Expect<() => 1, Returns.ToEqual<1>>

// with full matchers
Expect<1, _.ToBeDefined>
Expect<1, _.ToBeLessThan<2>>
Expect<[1, 2, 3], _.ToHaveLength<3>>
Expect<{ a: 1 }, _.ToHaveProperty<"a">>
Expect<{ a: 1 }, _.Not.ToMatch<{ b: 1 }>>
Expect<() => 1, _.Returns.ToEqual<1>>

type GuardFn = (input: any) => input is { a: 1 }
Expect<GuardFn, _.Guards.ToEqual<{ a: 1 }>>

type PromiseValue = Promise<1>
Expect<PromiseValue, _.Resolves.ToEqual<1>>

FAQs

Package last updated on 08 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts