Skip to content

Commit

Permalink
docs: fix {@linkcode ...} syntax to support external modules
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed Aug 21, 2024
1 parent 243dfc5 commit 61a040b
Show file tree
Hide file tree
Showing 36 changed files with 185 additions and 155 deletions.
8 changes: 4 additions & 4 deletions as/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const as: {
/**
* Annotate the given predicate function as optional.
*
* Use this function to annotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to annotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* Note that the annotated predicate function will return `true` if the type of `x` is `T` or `undefined`, indicating that
* this function is not just for annotation but it also changes the behavior of the predicate function.
Expand All @@ -40,7 +40,7 @@ export const as: {
/**
* Annotate the given predicate function as readonly.
*
* Use this function to annotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to annotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* Use {@linkcode asUnreadonly} to remove the annotation.
* Use {@linkcode hasReadonly} to check if a predicate function has annotated with this function.
Expand All @@ -63,7 +63,7 @@ export const as: {
/**
* Unannotate the annotated predicate function with {@linkcode asOptional}.
*
* Use this function to unannotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to unannotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* Note that the annotated predicate function will return `true` if the type of `x` is `T`, indicating that
* this function is not just for annotation but it also changes the behavior of the predicate function.
Expand All @@ -86,7 +86,7 @@ export const as: {
/**
* Unannotate the annotated predicate function with {@linkcode asReadonly}.
*
* Use this function to unannotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to unannotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
*
Expand Down
4 changes: 2 additions & 2 deletions as/optional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
/**
* Annotate the given predicate function as optional.
*
* Use this function to annotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to annotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* Note that the annotated predicate function will return `true` if the type of `x` is `T` or `undefined`, indicating that
* this function is not just for annotation but it also changes the behavior of the predicate function.
Expand Down Expand Up @@ -61,7 +61,7 @@ export function asOptional<P extends Predicate<unknown>>(
/**
* Unannotate the annotated predicate function with {@linkcode asOptional}.
*
* Use this function to unannotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to unannotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* Note that the annotated predicate function will return `true` if the type of `x` is `T`, indicating that
* this function is not just for annotation but it also changes the behavior of the predicate function.
Expand Down
4 changes: 2 additions & 2 deletions as/readonly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
/**
* Annotate the given predicate function as readonly.
*
* Use this function to annotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to annotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* Use {@linkcode asUnreadonly} to remove the annotation.
* Use {@linkcode hasReadonly} to check if a predicate function has annotated with this function.
Expand Down Expand Up @@ -45,7 +45,7 @@ export function asReadonly<P extends Predicate<unknown>>(
/**
* Unannotate the annotated predicate function with {@linkcode asReadonly}.
*
* Use this function to unannotate a predicate function of `predObj` in {@linkcode isObjectOf}.
* Use this function to unannotate a predicate function of `predObj` in {@linkcode [is/object-of].isObjectOf|isObjectOf}.
*
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
*
Expand Down
2 changes: 1 addition & 1 deletion ensure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { assert } from "./assert.ts";
/**
* Ensures that the given value satisfies the provided predicate.
*
* It throws {@linkcode AssertError} if the value does not satisfy the predicate.
* It throws {@linkcode [assert].AssertError|AssertError} if the value does not satisfy the predicate.
*
* ```ts
* import { ensure, is } from "@core/unknownutil";
Expand Down
2 changes: 1 addition & 1 deletion is/any.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Assume `x is `any` and always return `true` regardless of the type of `x`.
*
* Use {@linkcode isUnknown} to assume that a value is `unknown`.
* Use {@linkcode [is/unknown].isUnknown|isUnknown} to assume that a value is `unknown`.
*
* ```ts
* import { is } from "@core/unknownutil";
Expand Down
2 changes: 1 addition & 1 deletion is/array.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Return `true` if the type of `x` is `unknown[]`.
*
* Use {@linkcode isArrayOf} to check if the type of `x` is an array of `T`.
* Use {@linkcode [is/arrayt-of].isArrayOf|isArrayOf} to check if the type of `x` is an array of `T`.
*
* ```ts
* import { is } from "@core/unknownutil";
Expand Down
2 changes: 1 addition & 1 deletion is/array_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { isArray } from "./array.ts";
/**
* Return a type predicate function that returns `true` if the type of `x` is `T[]`.
*
* Use {@linkcode isArray} to check if the type of `x` is an array of `unknown`.
* Use {@linkcode [is/array].isArray|isArray} to check if the type of `x` is an array of `unknown`.
*
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
*
Expand Down
4 changes: 2 additions & 2 deletions is/async_function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const objectToString = Object.prototype.toString;
/**
* Return `true` if the type of `x` is `function` (async function).
*
* Use {@linkcode isFunction} to check if the type of `x` is a function.
* Use {@linkcode isSyncFunction} to check if the type of `x` is a synchronous function.
* Use {@linkcode [is/function].isFunction|isFunction} to check if the type of `x` is a function.
* Use {@linkcode [is/sync-function].isSyncFunction|isSyncFunction} to check if the type of `x` is a synchronous function.
*
* ```ts
* import { is } from "@core/unknownutil";
Expand Down
4 changes: 2 additions & 2 deletions is/function.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Return `true` if the type of `x` is `function`.
*
* Use {@linkcode isSyncFunction} to check if the type of `x` is a synchronous function.
* Use {@linkcode isAsyncFunction} to check if the type of `x` is an asynchronous function.
* Use {@linkcode [is/sync-function].isSyncFunction|isSyncFunction} to check if the type of `x` is a synchronous function.
* Use {@linkcode [is/async-function].isAsyncFunction|isAsyncFunction} to check if the type of `x` is an asynchronous function.
*
* ```ts
* import { is } from "@core/unknownutil";
Expand Down
2 changes: 1 addition & 1 deletion is/intersection_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isObjectOf } from "./object_of.ts";
/**
* Return a type predicate function that returns `true` if the type of `x` is `IntersectionOf<T>`.
*
* Use {@linkcode isUnionOf} to check if the type of `x` is a union of `T`.
* Use {@linkcode [is/union-of].isUnionOf|isUnionOf} to check if the type of `x` is a union of `T`.
*
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
*
Expand Down
4 changes: 2 additions & 2 deletions is/literal_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { Predicate, Primitive } from "../type.ts";
/**
* Return a type predicate function that returns `true` if the type of `x` is a literal type of `pred`.
*
* Use {@linkcode isLiteral} to check if the type of `x` is a literal type.
* Use {@linkcode isLiteralOneOf} to check if the type of `x` is one of the literal type of `Primitive[]`.
* Use {@linkcode [is/literal].isLiteral|isLiteral} to check if the type of `x` is a literal type.
* Use {@linkcode [is/literal-one-of].isLiteralOneOf|isLiteralOneOf} to check if the type of `x` is one of the literal type of {@linkcode [type].Primitive|Primitive[]}.
*
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
*
Expand Down
4 changes: 2 additions & 2 deletions is/literal_one_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { Predicate, Primitive } from "../type.ts";
/**
* Return a type predicate function that returns `true` if the type of `x` is one of literal type in `preds`.
*
* Use {@linkcode isLiteral} to check if the type of `x` is a literal type.
* Use {@linkcode isLiteralOf} to check if the type of `x` is a literal type of `Primitive`.
* Use {@linkcode [is/literal].isLiteral|isLiteral} to check if the type of `x` is a literal type.
* Use {@linkcode [is/literal-of].isLiteralOf|isLiteralOf} to check if the type of `x` is a literal type of {@linkcode [type].Primitive|Primitive}.
*
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
*
Expand Down
2 changes: 1 addition & 1 deletion is/map.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Return `true` if the type of `x` is `Map<unknown, unknown>`.
*
* Use {@linkcode isMapOf} to check if the type of `x` is a map of `T`.
* Use {@linkcode [is/map-of].isMapOf|isMapOf} to check if the type of `x` is a map of `T`.
*
* ```ts
* import { is } from "@core/unknownutil";
Expand Down
2 changes: 1 addition & 1 deletion is/map_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { isMap } from "./map.ts";
/**
* Return a type predicate function that returns `true` if the type of `x` is `Map<K, T>`.
*
* Use {@linkcode isMap} to check if the type of `x` is a map of `unknown`.
* Use {@linkcode [is/map].isMap|isMap} to check if the type of `x` is a map of `unknown`.
*
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
*
Expand Down
Loading

0 comments on commit 61a040b

Please sign in to comment.