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

do-try-tuple

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

do-try-tuple - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "do-try-tuple",
"version": "1.0.3",
"version": "1.0.4",
"description": "Catches errors and rejected promises, returns tuple",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -201,3 +201,3 @@ # do-try-tuple [![Coverage Status](https://coveralls.io/repos/github/DScheglov/do-try-tuple/badge.svg?branch=main)](https://coveralls.io/github/DScheglov/do-try-tuple?branch=main) [![npm version](https://img.shields.io/npm/v/do-try-tuple.svg?style=flat-square)](https://www.npmjs.com/package/do-try-tuple) [![npm downloads](https://img.shields.io/npm/dm/do-try-tuple.svg?style=flat-square)](https://www.npmjs.com/package/do-try-tuple) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/DScheglov/do-try-tuple/blob/master/LICENSE)

```typescript
const fetchUsers = () => {
const fetchUsers = (): Promise<string[]> => {
if (Math.random() < 0.5) throw new Error('Failed to fetch users');

@@ -233,4 +233,4 @@ return Promise.resolve(['Alice', 'Bob', 'Charlie']);

```typescript
// WRONG
const [err, value] = await doTry(() => someFn(...))
// WRONG ___________
const [err, value] = await doTry(/* async */() => someFn(...))
.then(([err, value]) => {

@@ -237,0 +237,0 @@ // handle err and value

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