Skip to content

Commit 8483ad3

Browse files
committed
docs: update jsdoc comments
1 parent 27bca81 commit 8483ad3

26 files changed

+43
-36
lines changed

async/chain.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
* console.log(await toArray(iter)); // [1, 2, 3, 4]
1414
* ```
1515
*
16-
* It supports chaining malformed iterables.
17-
*
18-
* @example
16+
* @example With malformed iterables
1917
* ```ts
2018
* import { toArray } from "@core/iterutil/async/to-array";
2119
* import { chain } from "@core/iterutil/async/chain";
@@ -36,6 +34,9 @@ export async function* chain<
3634
}
3735
}
3836

37+
/**
38+
* @inner
39+
*/
3940
export type Chain<T> = T extends readonly [] ? never
4041
: T extends readonly [Iterable<infer U>] ? U
4142
: T extends readonly [AsyncIterable<infer U>] ? U

async/compact.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Removes all nullish values from an iterable.
2+
* Removes all nullish (`null` or `undefined`) values from an iterable.
33
*
44
* @param iterable The iterable to compact.
55
* @returns The compacted iterable.

async/compress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Compress an iterable by selecting elements using a selector iterable.
2+
* Compresses an iterable by selecting elements using a selector iterable.
33
*
44
* @param iterable The iterable to compress.
55
* @param selectors The selectors to use.

async/drop.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
22
* Drops the first `limit` items from the iterable.
33
*
4-
* It throws an error if `limit` is less than 0.
5-
*
64
* @param iterable The iterable to drop items from.
7-
* @param limit The number of items to drop.
5+
* @param limit The number of items to drop. It must be 0 or positive safe integer.
86
* @returns The iterable with the first `limit` items dropped.
7+
* @throws {DropLimitError} If `limit` is less than 0 or non safe integer.
98
*
109
* @example
1110
* ```ts

async/enumerate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Enumerate an iterable.
2+
* Enumerates an iterable.
33
*
44
* @param iterable The iterable to enumerate.
55
* @param start The starting index.

async/first.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* Returns the first element of an iterable.
3-
* If the iterable is empty, returns `undefined`.
2+
* Returns the first element of an iterable. If the iterable is empty, returns `undefined`.
43
*
54
* @param iterable The iterable to get the first element from.
65
* @returns The first element of the iterable, or `undefined` if the iterable is empty.

async/for_each.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @example
88
* ```ts
99
* import { forEach } from "@core/iterutil/async/for-each";
10+
*
1011
* await forEach([1, 2, 3], console.log);
1112
* // 1
1213
* // 2

async/iter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Convert an iterable to an iterator.
2+
* Converts an iterable to an iterator.
33
*
44
* @param iterable The iterable to convert.
55
* @returns The iterator.

async/take.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
2-
* Take the first `limit` items from the iterable.
3-
*
4-
* It throws an error if `limit` is less than 0.
2+
* Takes the first `limit` items from the iterable.
53
*
64
* @param iterable The iterable to take items from.
7-
* @param limit The number of items to take.
5+
* @param limit The number of items to take. It must be 0 or positive safe integer.
86
* @returns The iterable with the first `limit` items taken.
7+
* @throws {TakeLimitError} If `limit` is less than 0 or non safe integer.
98
*
109
* @example
1110
* ```ts

async/take_while.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Take elements from the iterable while the predicate is true.
2+
* Takes elements from the iterable while the predicate is true.
33
*
44
* @param iterable The iterable to take elements from.
55
* @param fn The predicate to take elements with.

0 commit comments

Comments
 (0)