We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8b5423 commit 4339596Copy full SHA for 4339596
src/new.ts
@@ -56,16 +56,16 @@ export async function tryAsync<T>(promise: Promise<T>): Promise<Result<T>> {
56
57
/**
58
*
59
- * Function that takes in a function and catches errors in it.
+ * Function that takes in a callback and catches errors in it.
60
* Collects either the value or the error in a **_Result_** type.
61
62
- * @param func any function that can throw
+ * @param callback any function that can throw
63
* @returns a **_Result_** type
64
65
*/
66
-export function trySync<T>(func: () => T): Result<T> {
+export function trySync<T>(callback: () => T): Result<T> {
67
try {
68
- const ok = func();
+ const ok = callback();
69
return ok;
70
} catch (err) {
71
return err as Error;
0 commit comments