Socket
Socket
Sign inDemoInstall

ts-algebra

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-algebra

Types on steroids 💊


Version published
Weekly downloads
514K
increased by1.7%
Maintainers
1
Weekly downloads
 
Created

What is ts-algebra?

The ts-algebra npm package provides utilities for advanced type-level programming in TypeScript. It allows developers to perform complex type manipulations and algebraic operations on types, enabling more expressive and safer TypeScript code.

What are ts-algebra's main functionalities?

Type-Level Arithmetic

This feature allows you to perform arithmetic operations at the type level. In this example, the `Add` utility is used to add two numbers, resulting in a type that represents the sum.

import { Add } from 'ts-algebra';

type Result = Add<3, 4>; // Result is 7

Type-Level Logic

This feature provides logical operations at the type level. The `And` and `Or` utilities can be used to combine boolean types, resulting in a type that represents the logical outcome.

import { And, Or } from 'ts-algebra';

type True = true;
type False = false;

type Result1 = And<True, False>; // Result1 is false
type Result2 = Or<True, False>; // Result2 is true

Type-Level Comparisons

This feature allows you to perform comparisons at the type level. The `GreaterThan` utility checks if one number type is greater than another, resulting in a boolean type.

import { GreaterThan } from 'ts-algebra';

type Result = GreaterThan<5, 3>; // Result is true

Other packages similar to ts-algebra

Keywords

FAQs

Package last updated on 04 May 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

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