Socket
Socket
Sign inDemoInstall

type-fest

Package Overview
Dependencies
0
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    type-fest

A collection of essential TypeScript types


Version published
Maintainers
1
Install size
5.76 kB
Created

Package description

What is type-fest?

The type-fest package provides a collection of essential TypeScript types for use in a wide range of applications. It includes utility types, primitive types, and complex object types to enhance TypeScript's static typing capabilities.

What are type-fest's main functionalities?

Primitive types

Includes types like LiteralUnion, Primitive, and Promisable, which help with defining literals, primitive values, and promise-like structures.

{"isPrimitive": true}

Basic utilities

Provides utility types such as Except, Mutable, ReadonlyDeep, and many others that help manipulate and transform types in various ways.

{"isEmptyArray": array.length === 0}

Object types

Contains types for working with objects, such as Merge and RequireAtLeastOne, which assist in merging types and ensuring at least one property is present, respectively.

{"isObjectClean": Object.keys(object).length === 0 && object.constructor === Object}

Conditional types

Includes conditional types like ConditionalExcept and ConditionalKeys, which apply conditions to filter keys or properties of types.

{"isTruthy": T extends false | '' | 0 | null | undefined ? false : true}

Other packages similar to type-fest

Readme

Source


type-fest

A collection of essential TypeScript types



Build Status

Many of the types here should have been built-in.

Either add this package as a dependency or copy-paste the needed types. No credit required.

PR welcome for additional commonly needed types and docs improvements.

Install

$ npm install type-fest

Usage

import {Omit} from 'type-fest';

type Foo = {
	unicorn: string;
	rainbow: boolean;
};

type FooWithoutRainbow = Omit<Foo, 'rainbow'>;
//=> {unicorn: string}

API

See the types file.

License

(MIT OR CC0-1.0)

Keywords

FAQs

Last updated on 13 Mar 2019

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