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

ts-typekit

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-typekit

A Collection of TypeScript Utility Types

latest
npmnpm
Version
1.6.0
Version published
Weekly downloads
1
-50%
Maintainers
0
Weekly downloads
 
Created
Source

ts-typekit

ts-typekit

🧰 Collection of TypeScript utility types

Version Downloads Type Coverage Software License

  • No Runtime Cost: ts-typekit operates exclusively at compile-time, meaning it introduces zero overhead to your runtime performance.

  • Battle-tested: All utility types within ts-typekit are rigorously tested using tsd, providing you with confidence and reliability in their usage.

  • Type Safety: By leveraging ts-typekit, you can enforce stricter type checks, reducing the likelihood of type-related errors and improving the overall robustness of your TypeScript applications.

Whether you're dealing with complex type transformations, conditional types, or need to enforce specific type constraints, ts-typekit has you covered with a growing collection of utility types that cater to a variety of common and advanced use cases.

Install

npm install ts-typekit
yarn add ts-typekit

Requires TypeScript >= 5.1

Usage

import type { StrictOmit } from 'ts-typekit';

type User = {
  id: number;
  name: string;
};

type UserWithoutId = StrictOmit<User, 'id'>; // { name: string }

Tip

Recommend working with the {strict: true} option in tsconfig.

If your team is using ESLint and wants to enforce the use of StrictOmit instead of the standard Omit, you can configure ESLint to help catch this. The @typescript-eslint/ban-types rule can be configured to display an error message when Omit is used, guiding developers to use StirctOmit instead. Here's how you can set up your ESLint configuration:

module.exports = {
  parser: '@typescript-eslint/parser',
  plugins: ['@typescript-eslint'],
  rules: {
    // Include other relevant rules here
    '@typescript-eslint/ban-types': [
      'error',
      {
        types: {
          Omit: 'Use StrictOmit instead', // write the error message.
        },
        extendsDefaults: true,
      },
    ],
  },
};

Contributing

Read below for detailed contribution guide.

CONTRIBUTING

Contributors

Thanks for considering contributing to ts-typekit.

haejunejung
haejunejung

Keywords

typescript

FAQs

Package last updated on 24 Sep 2024

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