Skip to content

Commit

Permalink
FIX: Add deprecated sign to old functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahme-dev committed May 26, 2023
1 parent ba9a20a commit 94b2a75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/old.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
*
* @deprecated this function is deprecated, use the newer trySync
*
* takes in a function, and catches any errors in it
* then returns either the function's returned or the error
Expand All @@ -18,6 +20,9 @@ export async function resultAll<T>(func: () => T): Promise<T | Error> {
}

/**
*
*
* @deprecated this function is deprecated, use the newer tryAsync
*
* Takes in an async function and catches errors in it
* then returns either the function's returned or the error
Expand All @@ -38,6 +43,8 @@ export async function resultAsync<T>(promise: Promise<T>): Promise<T | Error> {
// used to type guard against results being errors

/**
*
* @deprecated this function is deprecated, use the newer isError
*
* Takes in a value which can possibly be of type error and returns a boolean indicating if it was or not.
* Also it'll act as a type constraint, making the variable change from union type to the value type, in subsequent code.
Expand Down

0 comments on commit 94b2a75

Please sign in to comment.