do-try-tuple
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14354