Socket
Socket
Sign inDemoInstall

check-dts

Package Overview
Dependencies
27
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    check-dts

Unit tests for .d.ts TypeScript definitions


Version published
Weekly downloads
1.2K
decreased by-4.83%
Maintainers
1
Install size
633 kB
Created
Weekly downloads
 

Changelog

Source

0.7.2

  • Fix rare TypeScript errors support (by Brian Takita).

Readme

Source

Check TypeScript Definitions

Unit tests for .d.ts TypeScript definitions in your JavaScript open source library.

It is useful for non-TypeScript project, which wants to provide typing support for TypeScript users and autocompletion for IDE and text editors.

It becomes especially useful for complex types with generics, like we have in Nano Events or Storeon.

// Negative test: test/index.errors.ts
import lib = require('../')

interface Events {
  'set': (a: string, b: number) => void
}
// THROWS Expected 3 arguments, but got 2
lib.on<Events>('set', 2)
// Positive test: test/index.types.ts
import lib = require('../')

interface Events {
  'set': (a: string, b: number) => void
}
lib.on<Events>('set', 'prop', 1)
Print Snapshots example Sponsored by Evil Martians

Docs

Read full docs here.

Keywords

FAQs

Last updated on 29 Apr 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc