docs(collections,internal,media-types): use @typeParam tag instead of @template (#4772)

This commit is contained in:
Asher Gomez 2024-05-20 17:34:47 +10:00 committed by GitHub
parent 47627516f0
commit e07a1e6a87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
50 changed files with 89 additions and 89 deletions

View File

@ -129,23 +129,23 @@ function assertHasExampleTag(tags: JsDocTag[], document: DocNodeBase) {
} }
} }
function assertHasTemplateTags( function assertHasTypeParamTags(
tags: JsDocTag[], tags: JsDocTag[],
template: string, typeParamName: string,
document: DocNodeBase, document: DocNodeBase,
) { ) {
const tag = tags.find((tag) => const tag = tags.find((tag) =>
tag.kind === "template" && tag.name === template tag.kind === "template" && tag.name === typeParamName
); );
assert( assert(
tag !== undefined, tag !== undefined,
`Symbol must have a @template tag for ${template}`, `Symbol must have a @typeParam tag for ${typeParamName}`,
document, document,
); );
assert( assert(
// @ts-ignore doc is defined // @ts-ignore doc is defined
tag.doc !== undefined, tag.doc !== undefined,
`@template tag for ${template} must have a description`, `@typeParam tag for ${typeParamName} must have a description`,
document, document,
); );
} }
@ -168,7 +168,7 @@ function assertFunctionDocs(document: DocNodeFunction) {
} }
} }
for (const typeParam of document.functionDef.typeParams) { for (const typeParam of document.functionDef.typeParams) {
assertHasTemplateTags(tags, typeParam.name, document); assertHasTypeParamTags(tags, typeParam.name, document);
} }
assertHasTag(tags, "return", document); assertHasTag(tags, "return", document);
assertHasExampleTag(tags, document); assertHasExampleTag(tags, document);

View File

@ -7,8 +7,8 @@ import { mapEntries } from "./map_entries.ts";
* Applies the given aggregator to each group in the given grouping, returning the * Applies the given aggregator to each group in the given grouping, returning the
* results together with the respective group keys * results together with the respective group keys
* *
* @template T Type of the values in the input record. * @typeParam T Type of the values in the input record.
* @template A Type of the accumulator value, which will match the returned * @typeParam A Type of the accumulator value, which will match the returned
* record's values. * record's values.
* *
* @param record The grouping to aggregate. * @param record The grouping to aggregate.

View File

@ -8,7 +8,7 @@
* If the selector produces the same key for multiple elements, the latest one * If the selector produces the same key for multiple elements, the latest one
* will be used (overriding the ones before it). * will be used (overriding the ones before it).
* *
* @template T Type of the elements in the input array. * @typeParam T Type of the elements in the input array.
* *
* @param array The array to transform. * @param array The array to transform.
* @param selector The function to extract the key from each element. * @param selector The function to extract the key from each element.

View File

@ -8,7 +8,7 @@
* If any of two pairs would have the same value, the latest one will be used * If any of two pairs would have the same value, the latest one will be used
* (overriding the ones before it). * (overriding the ones before it).
* *
* @template T The type of the values returned by the selector function. * @typeParam T The type of the values returned by the selector function.
* *
* @param array The array of elements to associate with values. * @param array The array of elements to associate with values.
* @param selector The selector function that returns a value for each element. * @param selector The selector function that returns a value for each element.

View File

@ -4,7 +4,7 @@
/** /**
* Splits the given array into chunks of the given size and returns them. * Splits the given array into chunks of the given size and returns them.
* *
* @template T Type of the elements in the input array. * @typeParam T Type of the elements in the input array.
* *
* @param array The array to split into chunks. * @param array The array to split into chunks.
* @param size The size of the chunks. This must be a positive integer. * @param size The size of the chunks. This must be a positive integer.

View File

@ -10,7 +10,7 @@ import { filterInPlace } from "./_utils.ts";
* For arrays, maps and sets, a merging strategy can be specified to either * For arrays, maps and sets, a merging strategy can be specified to either
* `replace` values, or `merge` them instead. * `replace` values, or `merge` them instead.
* *
* @template T Type of the first record * @typeParam T Type of the first record
* *
* @param record First record to merge. * @param record First record to merge.
* @param other Second record to merge. * @param other Second record to merge.
@ -107,9 +107,9 @@ export function deepMerge<
* For arrays, maps and sets, a merging strategy can be specified to either * For arrays, maps and sets, a merging strategy can be specified to either
* `replace` values, or `merge` them instead. * `replace` values, or `merge` them instead.
* *
* @template T Type of the first record * @typeParam T Type of the first record
* @template U Type of the second record * @typeParam U Type of the second record
* @template Options Merging options * @typeParam Options Merging options
* *
* @param record First record to merge. * @param record First record to merge.
* @param other Second record to merge. * @param other Second record to merge.

View File

@ -5,7 +5,7 @@
* Returns all distinct elements in the given array, preserving order by first * Returns all distinct elements in the given array, preserving order by first
* occurrence. * occurrence.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* *
* @param array The array to filter for distinct elements. * @param array The array to filter for distinct elements.
* *

View File

@ -5,8 +5,8 @@
* Returns all elements in the given array that produce a distinct value using * Returns all elements in the given array that produce a distinct value using
* the given selector, preserving order by first occurrence. * the given selector, preserving order by first occurrence.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* @template D The type of the values produced by the selector function. * @typeParam D The type of the values produced by the selector function.
* *
* @param array The array to filter for distinct elements. * @param array The array to filter for distinct elements.
* @param selector The function to extract the value to compare for * @param selector The function to extract the value to compare for

View File

@ -5,7 +5,7 @@
* Returns a new array that drops all elements in the given collection until the * Returns a new array that drops all elements in the given collection until the
* last element that does not match the given predicate. * last element that does not match the given predicate.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* *
* @param array The array to drop elements from. * @param array The array to drop elements from.
* @param predicate The function to test each element for a condition. * @param predicate The function to test each element for a condition.

View File

@ -5,7 +5,7 @@
* Returns a new array that drops all elements in the given collection until the * Returns a new array that drops all elements in the given collection until the
* first element that does not match the given predicate. * first element that does not match the given predicate.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* *
* @param array The array to drop elements from. * @param array The array to drop elements from.
* @param predicate The function to test each element for a condition. * @param predicate The function to test each element for a condition.

View File

@ -5,7 +5,7 @@
* Returns a new record with all entries of the given record except the ones * Returns a new record with all entries of the given record except the ones
* that do not match the given predicate. * that do not match the given predicate.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* *
* @param record The record to filter entries from. * @param record The record to filter entries from.
* @param predicate The function to test each entry for a condition. * @param predicate The function to test each entry for a condition.

View File

@ -5,7 +5,7 @@
* Returns a new record with all entries of the given record except the ones that * Returns a new record with all entries of the given record except the ones that
* have a key that does not match the given predicate. * have a key that does not match the given predicate.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* *
* @param record The record to filter keys from. * @param record The record to filter keys from.
* @param predicate The function to test each key for a condition. * @param predicate The function to test each key for a condition.

View File

@ -5,7 +5,7 @@
* Returns a new record with all entries of the given record except the ones * Returns a new record with all entries of the given record except the ones
* that have a value that does not match the given predicate. * that have a value that does not match the given predicate.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* *
* @param record The record to filter values from. * @param record The record to filter values from.
* @param predicate The function to test each value for a condition. * @param predicate The function to test each value for a condition.

View File

@ -5,7 +5,7 @@
* Returns an element if and only if that element is the only one matching the * Returns an element if and only if that element is the only one matching the
* given condition. Returns `undefined` otherwise. * given condition. Returns `undefined` otherwise.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* *
* @param array The array to find a single element in. * @param array The array to find a single element in.
* @param predicate The function to test each element for a condition. * @param predicate The function to test each element for a condition.

View File

@ -6,8 +6,8 @@
* produced that is neither `null` nor `undefined` and returns that value. * produced that is neither `null` nor `undefined` and returns that value.
* Returns `undefined` if no such value is produced. * Returns `undefined` if no such value is produced.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* @template O The type of the value produced by the selector function. * @typeParam O The type of the value produced by the selector function.
* *
* @param array The array to select a value from. * @param array The array to select a value from.
* @param selector The function to extract a value from an element. * @param selector The function to extract a value from an element.

View File

@ -8,7 +8,7 @@
* Note: this doesn't work with non-primitive values. For example, * Note: this doesn't work with non-primitive values. For example,
* `includesValue({x: {}}, {})` returns false. * `includesValue({x: {}}, {})` returns false.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* *
* @param record The record to check for the given value. * @param record The record to check for the given value.
* @param value The value to check for in the record. * @param value The value to check for in the record.

View File

@ -7,7 +7,7 @@ import { filterInPlace } from "./_utils.ts";
* Returns all distinct elements that appear at least once in each of the given * Returns all distinct elements that appear at least once in each of the given
* arrays. * arrays.
* *
* @template T The type of the elements in the input arrays. * @typeParam T The type of the elements in the input arrays.
* *
* @param arrays The arrays to intersect. * @param arrays The arrays to intersect.
* *

View File

@ -13,7 +13,7 @@ export type InvertResult<T extends Record<PropertyKey, PropertyKey>> = {
* assignments of previous values. If the record contains values which aren't * assignments of previous values. If the record contains values which aren't
* {@linkcode PropertyKey}s their string representation is used as the key. * {@linkcode PropertyKey}s their string representation is used as the key.
* *
* @template T The type of the input record. * @typeParam T The type of the input record.
* *
* @param record The record to invert. * @param record The record to invert.
* *

View File

@ -16,8 +16,8 @@ export type InvertByResult<
* The corresponding inverted value of each inverted key is an array of keys * The corresponding inverted value of each inverted key is an array of keys
* responsible for generating the inverted value. * responsible for generating the inverted value.
* *
* @template R The type of the input record. * @typeParam R The type of the input record.
* @template T The type of the iterator function. * @typeParam T The type of the iterator function.
* *
* @param record The record to invert. * @param record The record to invert.
* @param transformer The function to transform keys. * @param transformer The function to transform keys.

View File

@ -45,7 +45,7 @@ export type JoinToStringOptions = {
* in which case only the first `limit` elements will be appended, followed by * in which case only the first `limit` elements will be appended, followed by
* the `truncated` string. * the `truncated` string.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* *
* @param array The array to join elements from. * @param array The array to join elements from.
* @param selector The function to transform elements to strings. * @param selector The function to transform elements to strings.

View File

@ -5,8 +5,8 @@
* Applies the given transformer to all entries in the given record and returns * Applies the given transformer to all entries in the given record and returns
* a new record containing the results. * a new record containing the results.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* @template O The type of the values in the output record. * @typeParam O The type of the values in the output record.
* *
* @param record The record to map entries from. * @param record The record to map entries from.
* @param transformer The function to transform each entry. * @param transformer The function to transform each entry.

View File

@ -8,7 +8,7 @@
* If the transformed entries contain the same key multiple times, only the last * If the transformed entries contain the same key multiple times, only the last
* one will appear in the returned record. * one will appear in the returned record.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* *
* @param record The record to map keys from. * @param record The record to map keys from.
* @param transformer The function to transform each key. * @param transformer The function to transform each key.

View File

@ -6,8 +6,8 @@
* using the given transformer, except the ones that were transformed to `null` * using the given transformer, except the ones that were transformed to `null`
* or `undefined`. * or `undefined`.
* *
* @template T The type of the elements in the input array. * @typeParam T The type of the elements in the input array.
* @template O The type of the elements in the output array. * @typeParam O The type of the elements in the output array.
* *
* @param array The array to map elements from. * @param array The array to map elements from.
* @param transformer The function to transform each element. * @param transformer The function to transform each element.

View File

@ -6,9 +6,9 @@
* new record containing the resulting keys associated to the last value that * new record containing the resulting keys associated to the last value that
* produced them. * produced them.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* @template O The type of the values in the output record. * @typeParam O The type of the values in the output record.
* @template K The type of the keys in the input and output records. * @typeParam K The type of the keys in the input and output records.
* *
* @param record The record to map values from. * @param record The record to map values from.
* @param transformer The function to transform each value. * @param transformer The function to transform each value.
@ -44,9 +44,9 @@ export function mapValues<T, O, K extends string>(
* new record containing the resulting keys associated to the last value that * new record containing the resulting keys associated to the last value that
* produced them. * produced them.
* *
* @template T The type of the values in the input record. * @typeParam T The type of the values in the input record.
* @template O The type of the values in the output record. * @typeParam O The type of the values in the output record.
* @template K The type of the keys in the input and output records. * @typeParam K The type of the keys in the input and output records.
* *
* @param record The record to map values from. * @param record The record to map values from.
* @param transformer The function to transform each value. * @param transformer The function to transform each value.

View File

@ -5,7 +5,7 @@
* Returns the first element that is the largest value of the given function or * Returns the first element that is the largest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the maximum element in. * @param array The array to find the maximum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -37,7 +37,7 @@ export function maxBy<T>(
* Returns the first element that is the largest value of the given function or * Returns the first element that is the largest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the maximum element in. * @param array The array to find the maximum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -69,7 +69,7 @@ export function maxBy<T>(
* Returns the first element that is the largest value of the given function or * Returns the first element that is the largest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the maximum element in. * @param array The array to find the maximum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -101,7 +101,7 @@ export function maxBy<T>(
* Returns the first element that is the largest value of the given function or * Returns the first element that is the largest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the maximum element in. * @param array The array to find the maximum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.

View File

@ -6,7 +6,7 @@
* returns the max value of all elements. If an empty array is provided the * returns the max value of all elements. If an empty array is provided the
* function will return undefined. * function will return undefined.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the maximum element in. * @param array The array to find the maximum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -39,7 +39,7 @@ export function maxOf<T>(
* returns the max value of all elements. If an empty array is provided the * returns the max value of all elements. If an empty array is provided the
* function will return undefined. * function will return undefined.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the maximum element in. * @param array The array to find the maximum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.

View File

@ -9,7 +9,7 @@
* which means that `comparator(a, b)` should return a negative number if * which means that `comparator(a, b)` should return a negative number if
* `a < b`, a positive number if `a > b` and `0` if `a === b`. * `a < b`, a positive number if `a > b` and `0` if `a === b`.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the maximum element in. * @param array The array to find the maximum element in.
* @param comparator The function to compare elements. * @param comparator The function to compare elements.

View File

@ -5,7 +5,7 @@
* Returns the first element that is the smallest value of the given function or * Returns the first element that is the smallest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the minimum element in. * @param array The array to find the minimum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -37,7 +37,7 @@ export function minBy<T>(
* Returns the first element that is the smallest value of the given function or * Returns the first element that is the smallest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the minimum element in. * @param array The array to find the minimum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -69,7 +69,7 @@ export function minBy<T>(
* Returns the first element that is the smallest value of the given function or * Returns the first element that is the smallest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the minimum element in. * @param array The array to find the minimum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -101,7 +101,7 @@ export function minBy<T>(
* Returns the first element that is the smallest value of the given function or * Returns the first element that is the smallest value of the given function or
* undefined if there are no elements. * undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the minimum element in. * @param array The array to find the minimum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.

View File

@ -6,7 +6,7 @@
* returns the min value of all elements. If an empty array is provided the * returns the min value of all elements. If an empty array is provided the
* function will return undefined. * function will return undefined.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the minimum element in. * @param array The array to find the minimum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.
@ -39,7 +39,7 @@ export function minOf<T>(
* returns the min value of all elements. If an empty array is provided the * returns the min value of all elements. If an empty array is provided the
* function will return undefined. * function will return undefined.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the minimum element in. * @param array The array to find the minimum element in.
* @param selector The function to get the value to compare from each element. * @param selector The function to get the value to compare from each element.

View File

@ -5,7 +5,7 @@
* Returns the first element having the smallest value according to the provided * Returns the first element having the smallest value according to the provided
* comparator or undefined if there are no elements. * comparator or undefined if there are no elements.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to find the minimum element in. * @param array The array to find the minimum element in.
* @param comparator The function to compare elements. * @param comparator The function to compare elements.

View File

@ -4,8 +4,8 @@
/** /**
* Creates a new object by excluding the specified keys from the provided object. * Creates a new object by excluding the specified keys from the provided object.
* *
* @template T The type of the object. * @typeParam T The type of the object.
* @template K The type of the keys to omit. * @typeParam K The type of the keys to omit.
* *
* @param obj The object to omit keys from. * @param obj The object to omit keys from.
* @param keys The keys to omit from the object. * @param keys The keys to omit from the object.

View File

@ -6,7 +6,7 @@
* the given array that match the given predicate and the second one containing * the given array that match the given predicate and the second one containing
* all that do not. * all that do not.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param array The array to partition. * @param array The array to partition.
* @param predicate The predicate function to determine which array an element * @param predicate The predicate function to determine which array an element
@ -40,8 +40,8 @@ export function partition<T>(
* allows you to specify a type-guard predicate function that narrows the type * allows you to specify a type-guard predicate function that narrows the type
* of the elements in the array. * of the elements in the array.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* @template U The type of the elements that match the predicate. * @typeParam U The type of the elements that match the predicate.
* *
* @param array The array to partition. * @param array The array to partition.
* @param predicate The type-guard predicate function to determine which array * @param predicate The type-guard predicate function to determine which array

View File

@ -6,7 +6,7 @@
* the given record that match the given predicate and the second one containing * the given record that match the given predicate and the second one containing
* all that do not. * all that do not.
* *
* @template T The type of the values in the record. * @typeParam T The type of the values in the record.
* *
* @param record The record to partition. * @param record The record to partition.
* @param predicate The predicate function to determine which entries go where. * @param predicate The predicate function to determine which entries go where.

View File

@ -6,7 +6,7 @@
* Ignores equality of elements, meaning this will always return the same * Ignores equality of elements, meaning this will always return the same
* number of permutations for a given length of input. * number of permutations for a given length of input.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* *
* @param inputArray The array to build permutations from. * @param inputArray The array to build permutations from.
* *

View File

@ -5,8 +5,8 @@
* Creates a new object by including the specified keys from the provided * Creates a new object by including the specified keys from the provided
* object. * object.
* *
* @template T The type of the object. * @typeParam T The type of the object.
* @template K The type of the keys. * @typeParam K The type of the keys.
* *
* @param obj The object to pick keys from. * @param obj The object to pick keys from.
* @param keys The keys to include in the new object. * @param keys The keys to include in the new object.

View File

@ -7,8 +7,8 @@ import { mapValues } from "./map_values.ts";
* Applies the given reducer to each group in the given grouping, returning the * Applies the given reducer to each group in the given grouping, returning the
* results together with the respective group keys. * results together with the respective group keys.
* *
* @template T input type of an item in a group in the given grouping. * @typeParam T input type of an item in a group in the given grouping.
* @template A type of the accumulator value, which will match the returned * @typeParam A type of the accumulator value, which will match the returned
* record's values. * record's values.
* *
* @param record The grouping to reduce. * @param record The grouping to reduce.

View File

@ -6,8 +6,8 @@
* result as the accumulator to the next respective call, starting with the * result as the accumulator to the next respective call, starting with the
* given initialValue. Returns all intermediate accumulator results. * given initialValue. Returns all intermediate accumulator results.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* @template O The type of the accumulator. * @typeParam O The type of the accumulator.
* *
* @param array The array to reduce. * @param array The array to reduce.
* @param reducer The reducer function to apply to each element. * @param reducer The reducer function to apply to each element.

View File

@ -6,8 +6,8 @@ import { randomInteger } from "./_utils.ts";
/** /**
* Returns a random element from the given array. * Returns a random element from the given array.
* *
* @template T The type of the elements in the array. * @typeParam T The type of the elements in the array.
* @template O The type of the accumulator. * @typeParam O The type of the accumulator.
* *
* @param array The array to sample from. * @param array The array to sample from.
* *

View File

@ -29,7 +29,7 @@ export interface SlidingWindowsOptions {
* If partial is set, windows will be generated for the last elements of the * If partial is set, windows will be generated for the last elements of the
* collection, resulting in some undefined values if size is greater than 1. * collection, resulting in some undefined values if size is greater than 1.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to generate sliding windows from. * @param array The array to generate sliding windows from.
* @param size The size of the sliding windows. * @param size The size of the sliding windows.

View File

@ -20,7 +20,7 @@ export type SortByOptions = {
* element. Ascending or descending order can be specified through the `order` * element. Ascending or descending order can be specified through the `order`
* option. By default, the elements are sorted in ascending order. * option. By default, the elements are sorted in ascending order.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to sort. * @param array The array to sort.
* @param selector The selector function to get the value to sort by. * @param selector The selector function to get the value to sort by.
@ -66,7 +66,7 @@ export function sortBy<T>(
* element. Ascending or descending order can be specified through the `order` * element. Ascending or descending order can be specified through the `order`
* option. By default, the elements are sorted in ascending order. * option. By default, the elements are sorted in ascending order.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to sort. * @param array The array to sort.
* @param selector The selector function to get the value to sort by. * @param selector The selector function to get the value to sort by.
@ -97,7 +97,7 @@ export function sortBy<T>(
* element. Ascending or descending order can be specified through the `order` * element. Ascending or descending order can be specified through the `order`
* option. By default, the elements are sorted in ascending order. * option. By default, the elements are sorted in ascending order.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to sort. * @param array The array to sort.
* @param selector The selector function to get the value to sort by. * @param selector The selector function to get the value to sort by.
@ -137,7 +137,7 @@ export function sortBy<T>(
* element. Ascending or descending order can be specified through the `order` * element. Ascending or descending order can be specified through the `order`
* option. By default, the elements are sorted in ascending order. * option. By default, the elements are sorted in ascending order.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to sort. * @param array The array to sort.
* @param selector The selector function to get the value to sort by. * @param selector The selector function to get the value to sort by.

View File

@ -5,7 +5,7 @@
* Applies the given selector to all elements in the given collection and * Applies the given selector to all elements in the given collection and
* calculates the sum of the results. * calculates the sum of the results.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to calculate the sum of. * @param array The array to calculate the sum of.
* @param selector The selector function to get the value to sum. * @param selector The selector function to get the value to sum.

View File

@ -5,7 +5,7 @@
* Returns all elements in the given array after the last element that does not * Returns all elements in the given array after the last element that does not
* match the given predicate. * match the given predicate.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to take elements from. * @param array The array to take elements from.
* @param predicate The predicate function to determine if an element should be * @param predicate The predicate function to determine if an element should be

View File

@ -5,7 +5,7 @@
* Returns all elements in the given collection until the first element that * Returns all elements in the given collection until the first element that
* does not match the given predicate. * does not match the given predicate.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to take elements from. * @param array The array to take elements from.
* @param predicate The predicate function to determine if an element should be * @param predicate The predicate function to determine if an element should be

View File

@ -4,7 +4,7 @@
/** /**
* Returns all distinct elements that appear in any of the given arrays. * Returns all distinct elements that appear in any of the given arrays.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param arrays The arrays to get the union of. * @param arrays The arrays to get the union of.
* *

View File

@ -6,8 +6,8 @@
* returned array holding all first tuple elements and the second one holding * returned array holding all first tuple elements and the second one holding
* all the second elements. * all the second elements.
* *
* @template T The type of the first tuple elements. * @typeParam T The type of the first tuple elements.
* @template U The type of the second tuple elements. * @typeParam U The type of the second tuple elements.
* *
* @param pairs The array of 2-tuples to unzip. * @param pairs The array of 2-tuples to unzip.
* *

View File

@ -4,7 +4,7 @@
/** /**
* Returns an array excluding all given values. * Returns an array excluding all given values.
* *
* @template T The type of the array elements. * @typeParam T The type of the array elements.
* *
* @param array The array to exclude values from. * @param array The array to exclude values from.
* @param values The values to exclude from the array. * @param values The values to exclude from the array.

View File

@ -7,7 +7,7 @@ import { minOf } from "./min_of.ts";
* Builds N-tuples of elements from the given N arrays with matching indices, * Builds N-tuples of elements from the given N arrays with matching indices,
* stopping when the smallest array's end is reached. * stopping when the smallest array's end is reached.
* *
* @template T the type of the tuples produced by this function. * @typeParam T the type of the tuples produced by this function.
* *
* @param arrays The arrays to zip. * @param arrays The arrays to zip.
* *

View File

@ -15,7 +15,7 @@ const ADDED = 3;
/** /**
* Creates an array of common elements between two arrays. * Creates an array of common elements between two arrays.
* *
* @template T The type of elements in the arrays. * @typeParam T The type of elements in the arrays.
* *
* @param A The first array. * @param A The first array.
* @param B The second array. * @param B The second array.
@ -122,7 +122,7 @@ function createFp(
/** /**
* Renders the differences between the actual and expected values. * Renders the differences between the actual and expected values.
* *
* @template T The type of elements in the arrays. * @typeParam T The type of elements in the arrays.
* *
* @param A Actual value * @param A Actual value
* @param B Expected value * @param B Expected value

View File

@ -6,7 +6,7 @@ export type DiffType = "removed" | "common" | "added";
/** /**
* Represents the result of a diff operation. * Represents the result of a diff operation.
* *
* @template T The type of the value in the diff result. * @typeParam T The type of the value in the diff result.
*/ */
export interface DiffResult<T> { export interface DiffResult<T> {
/** The type of the diff. */ /** The type of the diff. */

View File

@ -41,7 +41,7 @@ export type KnownExtensionOrType =
* > file name, use {@linkcode https://jsr.io/@std/path/doc/~/extname | extname} * > file name, use {@linkcode https://jsr.io/@std/path/doc/~/extname | extname}
* > to determine the extension and pass it here. * > to determine the extension and pass it here.
* *
* @template T Type of the extension or media type to resolve. * @typeParam T Type of the extension or media type to resolve.
* *
* @param extensionOrType The extension or media type to resolve. * @param extensionOrType The extension or media type to resolve.
* *