Skip to content

Commit 38f2694

Browse files
committed
docs: fix comment links
1 parent 73bf862 commit 38f2694

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/map.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function mapOk<T, U, E>(
3434

3535
/**
3636
* Maps the error of a Result, while leaving a successful Result unchanged.
37-
* You can provide a custom mapper, or use @link `mapErrToError` or `mapErrToString`.
37+
* You can provide a custom mapper, or use {@link mapErrToError} or {@link mapErrToString}.
3838
* @param result The Result to map.
3939
* @param fn The mapping function for the error.
4040
* @returns A new Result with the mapped error or the original value.
@@ -70,7 +70,7 @@ export function mapErr<T, E, F>(
7070
//
7171

7272
/**
73-
* Maps an error to an Error object. To be used with @link `mapErr`.
73+
* Maps an error to an Error object. To be used with {@link mapErr}.
7474
* If the error is already an Error, it returns it unchanged.
7575
* If the error is a string, it creates a new Error with that string.
7676
* If the error is an object, it converts it to a JSON string and creates a new Error.
@@ -103,7 +103,7 @@ export function mapErrToError<E>(error: E): Error {
103103
}
104104

105105
/**
106-
* Maps an error to a string representation. To be used with @link `mapErr`.
106+
* Maps an error to a string representation. To be used with {@link mapErr}.
107107
* @param error The error to map.
108108
* @returns A string representation of the error.
109109
* @example

src/try.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { err, ok, type Result } from "./result";
1616
* });
1717
* if (isErr(result)) {
1818
* // result.error is unknown and must be checked
19-
* // you can check @link `mapErr` for easier error mapping
19+
* you can check `mapErr` for easier error mapping
2020
* // or just use `tryFn` to auto convert thrown values to Error
2121
* if (result.error instanceof Error) {
2222
* console.error("An error occurred:", result.error.message);
@@ -49,7 +49,7 @@ export function tryUnknownFn<T, E = unknown>(
4949

5050
/**
5151
* Run a function, catching whatever's thrown and return a Result.
52-
* Note that this function will change thrown values to Error type. If you'd prefer to explicitly map errors, use @link `tryUnknownFn`.
52+
* Note that this function will change thrown values to Error type. If you'd prefer to explicitly map errors, use {@link `tryUnknownFn`}.
5353
* If the function throws an error, it will be caught and set as an Error under Err.
5454
* If the function returns a value, it will be set as Ok.
5555
* @param fn function to run (sync or async)

0 commit comments

Comments
 (0)