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

ts-toolbelt

Package Overview
Dependencies
Maintainers
1
Versions
916
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-toolbelt - npm Package Compare versions

Comparing version 1.0.31 to 1.0.32

3

package.json
{
"name": "ts-toolbelt",
"version": "1.0.31",
"version": "1.0.32",
"license": "Apache-2.0",

@@ -44,2 +44,3 @@ "author": "Pierre-Antoine Mills",

"eslint-plugin-react": "^7.13.0",
"npx": "^10.2.0",
"release-it": "^12.3.0",

@@ -46,0 +47,0 @@ "ts-node": "^8.2.0",

@@ -45,53 +45,55 @@ <p align="center">

- [About](#about)
- [Features](#features)
- [Getting started](#getting-started)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [Sponsoring issues](#sponsoring-issues)
- [Running tests](#running-tests)
- [Compatibility](#compatibility)
- [What's next](#whats-next)
- [Acknowledgments](#acknowledgments)
- [Contact](#contact)
- [Licence](#licence)
* [๐Ÿ“œ About](#-about)
* [๐ŸŽฉ Features](#-features)
* [๐Ÿ Getting started](#-getting-started)
* [๐Ÿ“– Documentation](#-documentation)
* [โž• Contributing](#-contributing)
* [๐Ÿ‘ Sponsoring issues](#-sponsoring-issues)
* [๐Ÿ’‰ Running tests](#-running-tests)
* [๐Ÿ”ง Compatibility](#-compatibility)
* [๐Ÿ”ฎ What's next](#-whats-next)
* [๐Ÿ™ Acknowledgments](#-acknowledgments)
## About
## ๐Ÿ“œ About
**ts-toolbelt** is a collection of types that makes programming with TypeScript even safer.
**ts-toolbelt** is a collection of types that makes TypeScript even **safer**.
It's goal is to improve type correctness while adding a whole new set of
**features** to TypeScript.
It's goal is to ensure type correctness without too much effort from
your part, while adding a whole new set of features to TypeScript.
It uses the type system itself for TypeScript to compute more complex types. In
other words, its API exposes types that trade **CPU & RAM** for higher type
safety.
### How?
**ts-toolbelt** completes TypeScript with a collection of more than **150**
tested types.
**ts-toolbelt** performs complex operations on types. It's API exposes types that will trade your CPU & RAM for a higher type safety.
#### Goals
* This package aims to be the home of all **utility types**
* To keep reasonable **performance**, so it won't bloat TS
* And write software that's more type-safe, more **robust**
* (And bring a whole new set of **features** to TypeScript)
### Demo
## ๐ŸŽฉ Features
## Features
Here's some of the most useful features:
Only the most useful features are mentioned here. You will find the complete
list in the [documentation](https://pirix-gh.github.io/ts-toolbelt/) website.
* Merge two types together (doc)
* Update the field of a type (doc)
* Make some fields optional (doc)
* Change a type at any depth! (doc)
* Concat two tuples together (doc)
* Get the last item of a tuple (doc)
* [Merge two types together](https://pirix-gh.github.io/ts-toolbelt/modules/_object_merge_.html#merge)
* [Update the field of a type](https://pirix-gh.github.io/ts-toolbelt/modules/_object_update_.html#update)
* [Make some fields optional](https://pirix-gh.github.io/ts-toolbelt/modules/_object_optional_.html#optional)
* [Change a type at any depth!](https://pirix-gh.github.io/ts-toolbelt/modules/_object_p_update_.html#update)
* [Concat two tuples together](https://pirix-gh.github.io/ts-toolbelt/modules/_tuple_concat_.html#concat)
* [Get the last item of a tuple](https://pirix-gh.github.io/ts-toolbelt/modules/_tuple_last_.html#last)
* ... and so much more
One of the goals of **ts-toolbelt** is to bring all the types one would ever
need to a single package.
<p align="center">
<img src="https://raw.githubusercontent.com/pirix-gh/ts-toolbelt/master/.github/demo.gif" id="demo">
<p align="center">
If you don't find the type you were looking for, please feel welcome to open
> If you don't find the type you are looking for, you are welcome to open
a [feature request](https://github.com/pirix-gh/ts-toolbelt/issues/new?template=---feature-request.md)!
## Getting Started
## ๐Ÿ Getting Started
The project is maintained to adapt to the constant changes of TypeScript. See [compatibility](#compatibility) for more information.
#### Prerequisites
### Prerequisites
```sh

@@ -101,3 +103,3 @@ npm install typescript@^3.5.0 --save

### Installation
#### Installation

@@ -108,30 +110,57 @@ ```sh

### Hello World
#### Hello World
```ts
import tb from 'ts-toolbelt'
import {A, B, C, F, I, N, O, S, T, U} from 'ts-toolbelt'
type merged = tb.O.Merge<{name: string}, {age: number}>
// {name: string, age: number}
type concat = tb.T.Concat<['hello'], ['world']>
// ['hello', 'world']
// Merge two `object` together
type merge = O.Merge<{name: string}, {age?: number}>
```
## Documentation
## [๐Ÿ“– Documentation โคข](https://pirix-gh.github.io/ts-toolbelt/)
Right above, you might have notices that we've used `O` and `T` to access the
tools. They stand for **O**bject and **T**uple, respectively. And the whole
library is organized the same way, around TypeScript concepts:
The project is organized around TypeScript's main concepts:
- A[ny]
- B[boolean]
-
| | | | | |
|----------------|----------------|-----------------|--------------|-------------|
| **A**(ny) | **C**(lass) | **I**(teration) | **O**(bject) | **T**(uple) |
| **B**(boolean) | **F**(unction) | **N**(umber) | **S**(tring) | **U**(nion) |
https://pirix-gh.github.io/ts-toolbelt/
## ๐ŸŽ Contributing
## Contributing
Contributions are what make the open source community such an amazing place to
learn, inspire, and create. Any contributions you make are **greatly appreciated**.
There are many ways to contribute to the project:
## Sponsoring issues
#### Community
* [Help the community with answers on Gitter](https://gitter.im/ts-toolbelt/community?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
* [Reporting bugs or requesting new features](https://github.com/pirix-gh/ts-toolbelt/issues/new/choose)
#### Codebase
* Improving existing documentation
* Add new types to the collection
#### Pull Requests
1. Fork the project
2. Clone your fork
3. Create a pr/**feature** branch
```sh
git checkout -b pr/CoolFeature
```
4. Commit your changes
```sh
git commit -m 'Added this CoolFeature'
```
5. Run the tests
6. Commit your changes
```sh
git push origin pr/CoolFeature
```
7. Open a pull request
## ๐Ÿ‘ Sponsoring issues
**Sponsored issues have higher priority over non-critical issues**.<br>
You can either request a new feature or a bug fix then fund it.
<a href="https://issuehunt.io/r/pirix-gh/ts-toolbelt">

@@ -141,11 +170,52 @@ <img

</a>
<br>
<br>
## Running tests
**The money will be transparently split with an issue's assignees.**
## Compatibility
## ๐Ÿ’‰ Running tests
## What's next
#### For this project
To run the `lint` & `type` tests, simply run:
## Acknowledgements
```sh
npm test
```
## Licence
#### For your project
What to test your own types? Get started:
```ts
import {A, B, C, F, I, N, O, S, T, U, Test} from 'ts-toolbelt'
const {checks, check} = Test
checks([
check<N.Plus<'1', '30'>, '31', Test.Pass>(),
check<N.Plus<'5', '-3'>, '2', Test.Pass>(),
])
```
## ๐Ÿ”ง Compatibility
The project is maintained to adapt to the constant
[changes of TypeScript](https://github.com/Microsoft/TypeScript/wiki/Roadmap):
| ts-toolbelt | typescript |
|-------------|------------|
| 1.0.x | 3.5.x |
## ๐Ÿ”ฎ What's next
* Automated performance tests
```sh
# performance is checked manually with
npx tsc --noEmit ----extendedDiagnostics
```
* Improve with user feedback
## ๐Ÿ™ Acknowledgements
Many, many thanks to all the
[contributors](https://github.com/pirix-gh/ts-toolbelt/graphs/contributors) and:
* [Matt McCutchen](https://github.com/mattmccutchen)
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