Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-type-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-type-utils

utility types

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
492
decreased by-22.03%
Maintainers
1
Weekly downloads
 
Created
Source

typescript-type-utils

This repo contains usefull typescript types, to be used across projects.

types

test-kit

the test kit types are utility types for ensuring the API signature of your code.

typesdescription
ExpectTrue<T>fails the build if "T" is not true
ExpectFalse<T>fails the build if "T" is not false
Equal<T1, T2>equal to true if "T1" is identical to "T2"
NotEqual<T1, T2>equal to true if "T1" is not identical to "T2"
VALID_ARGS<FUNC, ARGS_TUPPLE>equal to true if "FUNC" can accept "ARGS_TUPPLE"

example usage:

    type normalStrings = ExpectTrue<
        EQUAL<string, string>
    >

tuple-utils

utility types for manipulating tuple types

typesdescription
TupleToUnion<T>equal to a union of the items in the tuple
ReduceTupleOn<T, ID_FIELD, VALUE_FIELD>reduces the tuple to an object

contribution

  • no actual code files are allowed, only d.ts file
  • the types are separated according to usage context and can be found in the lib directory
  • all types must be tested, see examples in the test directory

FAQs

Package last updated on 30 Jul 2019

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc