New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

claritype

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

claritype

Typescript named type aliases to clarify the meaning of the variable

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

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

It's not always clear what does number or string type mean.

Let's imagine you are describing setTimeout

declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;

In't not clear what number to pass in timeout. Let's refactor it

type Milliseconds = number;
declare function setTimeout(handler: TimerHandler, timeout?: Milliseconds, ...arguments: any[]): number;

Now it's much more clear, and user will see hints when typing this function in IDE.

So this library is just a set of such aliases. For now it contains

export type Milliseconds = number;
export type Seconds = number;
export type Minutes = number;
export type Hours = number;
export type Days = number;
export type Months = number;
export type Years = number;
export type Centuries = number;

So use it to clarify your inputs!

Keywords

FAQs

Package last updated on 17 Sep 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