From f24bad623732da0d1b6e94770026be977e33eb8b Mon Sep 17 00:00:00 2001 From: Alisue Date: Thu, 8 Aug 2024 12:00:47 +0900 Subject: [PATCH] WIP --- chain.ts | 10 ++++++++-- chunked.ts | 5 ++++- compact.ts | 10 ++++++---- compress.ts | 8 +++++--- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/chain.ts b/chain.ts index f5009f6..e652ded 100644 --- a/chain.ts +++ b/chain.ts @@ -1,9 +1,8 @@ /** * Chains multiple iterables together. * - * @param iterables - The iterables to chain. + * @param ...iterables - The iterables to chain. * @returns The chained iterable. - * @see {@link module:iterutil/async/chain.chain} for the asynchronous version. * * @example * ```ts @@ -20,6 +19,10 @@ * const iter = chain([1, 2], ["a", "b"], [true]); * console.log([...iter]); // [1, 2, "a", "b", true] * ``` + * + * ## See also + * + * - {@link module:iterutil/async/chain.chain} for the asynchronous version. */ export function* chain[]>( ...iterables: T @@ -29,6 +32,9 @@ export function* chain[]>( } } +/** + * @internal + */ export type Chain = T extends readonly [] ? never : T extends readonly [Iterable] ? U : T extends readonly [Iterable, ...infer R] ? U | Chain diff --git a/chunked.ts b/chunked.ts index 41f952d..ff2769a 100644 --- a/chunked.ts +++ b/chunked.ts @@ -4,7 +4,6 @@ * @param iterable - The iterable to chunk. * @param size - The size of each chunk. * @return The chunked iterable. - * @see {@link module:iterutil/async/chunked.chunked} for the asynchronous version. * * @example * ```ts @@ -13,6 +12,10 @@ * const iter = chunked([1, 2, 3, 4, 5], 2); * console.log([...iter]); // [[1, 2], [3, 4], [5]] * ``` + * + * ## See also + * + * - {@link module:iterutil/async/chunked.chunked} for the asynchronous version. */ export function* chunked( iterable: Iterable, diff --git a/compact.ts b/compact.ts index 0278f84..9a0ee97 100644 --- a/compact.ts +++ b/compact.ts @@ -1,11 +1,8 @@ /** - * Removes all nullish ({@codelink null} or {@codelink undefined}) values from an iterable. + * Removes all nullish ({@linkcode null} or {@linkcode undefined}) values from an iterable. * * @param iterable - The iterable to compact. * @returns The compacted iterable. - * @see {@link module:iterutil/async/compact.compact} for the asynchronous version. - * @see {@link module:iterutil/compress.compress} to select elements based on a selector iterable. - * @see {@link module:iterutil/filter.filter} to remove values based on a predicate. * * @example * ```ts @@ -14,6 +11,11 @@ * const iter = compact([1, undefined, 2, null, 3]); * console.log([...iter]); // [1, 2, 3] * ``` + * + * ## See also + * - {@link module:iterutil/async/compact.compact} for the asynchronous version. + * - {@link module:iterutil/compress.compress} to select elements based on a selector iterable. + * - {@link module:iterutil/filter.filter} to remove values based on a predicate. */ export function* compact(iterable: Iterable): Iterable> { for (const value of iterable) { diff --git a/compress.ts b/compress.ts index 08982e7..bdb26ae 100644 --- a/compress.ts +++ b/compress.ts @@ -4,9 +4,6 @@ * @param iterable - The iterable to compress. * @param selectors - The selectors to use. * @returns The compressed iterable. - * @see {@link module:iterutil/async/compress.compress} for the asynchronous version. - * @see {@link module:iterutil/compact.compact} to remove nullish values from an iterable. - * @see {@link module:iterutil/filter.filter} to remove values based on a predicate. * * @example * ```ts @@ -15,6 +12,11 @@ * const iter = compress([1, 2, 3, 4, 5], [true, false, true, false, true]); * console.log([...iter]); // [1, 3, 5] * ``` + * + * ## See also + * - {@link module:iterutil/async/compress.compress} for the asynchronous version. + * - {@link module:iterutil/compact.compact} to remove nullish values from an iterable. + * - {@link module:iterutil/filter.filter} to remove values based on a predicate. */ export function* compress( iterable: Iterable,