Skip to content

Commit 4339596

Browse files
committed
FIX: Rename function to callback in trySync
1 parent e8b5423 commit 4339596

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/new.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ export async function tryAsync<T>(promise: Promise<T>): Promise<Result<T>> {
5656

5757
/**
5858
*
59-
* Function that takes in a function and catches errors in it.
59+
* Function that takes in a callback and catches errors in it.
6060
* Collects either the value or the error in a **_Result_** type.
6161
*
62-
* @param func any function that can throw
62+
* @param callback any function that can throw
6363
* @returns a **_Result_** type
6464
*
6565
*/
66-
export function trySync<T>(func: () => T): Result<T> {
66+
export function trySync<T>(callback: () => T): Result<T> {
6767
try {
68-
const ok = func();
68+
const ok = callback();
6969
return ok;
7070
} catch (err) {
7171
return err as Error;

0 commit comments

Comments
 (0)