Skip to content

Commit f24bad6

Browse files
committed
WIP
1 parent 63621ab commit f24bad6

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

chain.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/**
22
* Chains multiple iterables together.
33
*
4-
* @param iterables - The iterables to chain.
4+
* @param ...iterables - The iterables to chain.
55
* @returns The chained iterable.
6-
* @see {@link module:iterutil/async/chain.chain} for the asynchronous version.
76
*
87
* @example
98
* ```ts
@@ -20,6 +19,10 @@
2019
* const iter = chain([1, 2], ["a", "b"], [true]);
2120
* console.log([...iter]); // [1, 2, "a", "b", true]
2221
* ```
22+
*
23+
* ## See also
24+
*
25+
* - {@link module:iterutil/async/chain.chain} for the asynchronous version.
2326
*/
2427
export function* chain<T extends Iterable<unknown>[]>(
2528
...iterables: T
@@ -29,6 +32,9 @@ export function* chain<T extends Iterable<unknown>[]>(
2932
}
3033
}
3134

35+
/**
36+
* @internal
37+
*/
3238
export type Chain<T> = T extends readonly [] ? never
3339
: T extends readonly [Iterable<infer U>] ? U
3440
: T extends readonly [Iterable<infer U>, ...infer R] ? U | Chain<R>

chunked.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* @param iterable - The iterable to chunk.
55
* @param size - The size of each chunk.
66
* @return The chunked iterable.
7-
* @see {@link module:iterutil/async/chunked.chunked} for the asynchronous version.
87
*
98
* @example
109
* ```ts
@@ -13,6 +12,10 @@
1312
* const iter = chunked([1, 2, 3, 4, 5], 2);
1413
* console.log([...iter]); // [[1, 2], [3, 4], [5]]
1514
* ```
15+
*
16+
* ## See also
17+
*
18+
* - {@link module:iterutil/async/chunked.chunked} for the asynchronous version.
1619
*/
1720
export function* chunked<T>(
1821
iterable: Iterable<T>,

compact.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
/**
2-
* Removes all nullish ({@codelink null} or {@codelink undefined}) values from an iterable.
2+
* Removes all nullish ({@linkcode null} or {@linkcode undefined}) values from an iterable.
33
*
44
* @param iterable - The iterable to compact.
55
* @returns The compacted iterable.
6-
* @see {@link module:iterutil/async/compact.compact} for the asynchronous version.
7-
* @see {@link module:iterutil/compress.compress} to select elements based on a selector iterable.
8-
* @see {@link module:iterutil/filter.filter} to remove values based on a predicate.
96
*
107
* @example
118
* ```ts
@@ -14,6 +11,11 @@
1411
* const iter = compact([1, undefined, 2, null, 3]);
1512
* console.log([...iter]); // [1, 2, 3]
1613
* ```
14+
*
15+
* ## See also
16+
* - {@link module:iterutil/async/compact.compact} for the asynchronous version.
17+
* - {@link module:iterutil/compress.compress} to select elements based on a selector iterable.
18+
* - {@link module:iterutil/filter.filter} to remove values based on a predicate.
1719
*/
1820
export function* compact<T>(iterable: Iterable<T>): Iterable<NonNullable<T>> {
1921
for (const value of iterable) {

compress.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
* @param iterable - The iterable to compress.
55
* @param selectors - The selectors to use.
66
* @returns The compressed iterable.
7-
* @see {@link module:iterutil/async/compress.compress} for the asynchronous version.
8-
* @see {@link module:iterutil/compact.compact} to remove nullish values from an iterable.
9-
* @see {@link module:iterutil/filter.filter} to remove values based on a predicate.
107
*
118
* @example
129
* ```ts
@@ -15,6 +12,11 @@
1512
* const iter = compress([1, 2, 3, 4, 5], [true, false, true, false, true]);
1613
* console.log([...iter]); // [1, 3, 5]
1714
* ```
15+
*
16+
* ## See also
17+
* - {@link module:iterutil/async/compress.compress} for the asynchronous version.
18+
* - {@link module:iterutil/compact.compact} to remove nullish values from an iterable.
19+
* - {@link module:iterutil/filter.filter} to remove values based on a predicate.
1820
*/
1921
export function* compress<T>(
2022
iterable: Iterable<T>,

0 commit comments

Comments
 (0)