Detalhes do pacote

helpertypes

wessberg435.3kMIT0.0.19

A collection of TypeScript helper types

typescript, lib, type, helpers

readme (leia-me)

Logo

A collection of TypeScript helper types

Downloads per month NPM version Dependencies Contributors code style: prettier License: MIT Support on Patreon

Description

This is a simple collection of general purpose helper types for TypeScript that can be used across a wide variety of projects.

Features

  • General-purpose
  • Small
  • Just a few types, nothing else

Backers

Bubbles Christopher Blanchard Ideal Postcodes Xerox
Bubbles
Twitter: @usebubbles
Christopher Blanchard Ideal Postcodes Xerox

Patreon

Patrons on Patreon

Table of Contents

Install

npm

$ npm install helpertypes

Yarn

$ yarn add helpertypes

pnpm

$ pnpm add helpertypes

Usage

Simply import the types you want from helpertypes:

import {ElementOf} from "helpertypes";

const FAVORITE_FOOD = ["pizza", "burger", "lasagna"] as const;

// "pizza"|"burger"|"lasagna"
type FavoriteFood = ElementOf<typeof FAVORITE_FOOD>;

Contributing

Do you want to contribute? Awesome! Please follow these recommendations.

Maintainers

Frederik Wessberg
Frederik Wessberg
Twitter: @FredWessberg
Github: @wessberg
Lead Developer

FAQ

Will this library grow over time?

Yes, but only for helper types that have common applicability. Feel free to submit a PR, and we'll take a look at it then.

License

MIT © Frederik Wessberg (@FredWessberg) (Website)

changelog (log de mudanças)

0.0.19 (2022-11-09)

Features

  • add ObjectLookupString helper type (4a19d76)

0.0.18 (2021-11-18)

Bug Fixes

  • replace implementation of ObjectLookupTitle with one less prone to exceeding allowed recursive calls (171d7fe)

0.0.17 (2021-10-08)

Bug Fixes

  • yet another fix of RequiredDeep and PartialDeep (f3b366d)

0.0.16 (2021-10-08)

Bug Fixes

  • yet another fix of RequiredDeep and PartialDeep (df959c6)

0.0.15 (2021-10-08)

Bug Fixes

  • fix behavior of Next type (e918ac1)

0.0.14 (2021-10-08)

Features

  • add helper: PickIntersectingKeys (6ff5552)
  • add new helper: RequiredDeep (cb12d71)

0.0.13 (2021-10-06)

Features

  • add new helper types: PickOptional and PickRequired (1a9d2eb)

0.0.12 (2021-09-15)

Features

  • add additional helper types (7a6eb8e)

0.0.11 (2021-09-06)

Bug Fixes

  • add Function to ignored types in PartialDeep (ee8d6f2)

0.0.10 (2021-09-03)

Features

0.0.9 (2021-09-03)

Features

  • add 'ArrayPiercingObjectLookupTuple' (8ef5a03)

0.0.8 (2021-09-02)

Bug Fixes

  • add support for readonly arrays in ObjectLookupTuple (371a7ea)

0.0.7 (2021-09-02)

Features

  • add 'ObjectLookupTuple' helper type (5263180)

0.0.6 (2021-09-02)

Bug Fixes

  • include RegExp in as simple value in PartialDeep check (aebe2d6)

0.0.5 (2021-09-02)

Features

  • expose 'Prev' and 'Next' types (2b365f8)

0.0.4 (2021-08-22)

Features

  • add additional helper type: RequiredExcept (6b6998f)

0.0.3 (2021-06-06)

Features

  • add helpers: UppercaseKeys, LowercaseKeys, CapitalizeKeys, UncapitalizeKeys (6ce3bfd)

0.0.2 (2021-05-27)

Features

0.0.1 (2021-05-26)