Skip to content

Commit 63621ab

Browse files
committed
chore: WIP
1 parent 4f964ad commit 63621ab

File tree

15 files changed

+74
-41
lines changed

15 files changed

+74
-41
lines changed

chain.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
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.
67
*
78
* @example
89
* ```ts
@@ -12,8 +13,6 @@
1213
* console.log([...iter]); // [1, 2, 3, 4]
1314
* ```
1415
*
15-
* It supports chaining malformed iterables.
16-
*
1716
* @example
1817
* ```ts
1918
* import { chain } from "@core/iterutil/chain";

chunked.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
22
* Chunks an iterable into arrays of a given size.
33
*
4-
* @param iterable The iterable to chunk.
5-
* @param size The size of each chunk.
6-
* @returns The chunked iterable.
4+
* @param iterable - The iterable to chunk.
5+
* @param size - The size of each chunk.
6+
* @return The chunked iterable.
7+
* @see {@link module:iterutil/async/chunked.chunked} for the asynchronous version.
78
*
89
* @example
910
* ```ts

compact.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/**
2-
* Removes all nullish values from an iterable.
2+
* Removes all nullish ({@codelink null} or {@codelink undefined}) values from an iterable.
33
*
4-
* @param iterable The iterable to compact.
4+
* @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.
69
*
710
* @example
811
* ```ts

compress.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/**
22
* Compress an iterable by selecting elements using a selector iterable.
33
*
4-
* @param iterable The iterable to compress.
5-
* @param selectors The selectors to use.
4+
* @param iterable - The iterable to compress.
5+
* @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.
710
*
811
* @example
912
* ```ts

count.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/**
22
* Generates an infinite sequence of numbers starting from `start` with a step of `step`.
33
*
4-
* @param start The number to start the sequence from.
5-
* @param step The step between each number in the sequence.
4+
* @param - start The number to start the sequence from.
5+
* @param - step The step between each number in the sequence.
66
* @returns The count iterable.
7+
* @see {@link module:iterutil/take.take} to take a specific number of elements from the iterable.
8+
* @see {@link module:iterutil/range.range} for a finite version of this function.
79
*
810
* @example
911
* ```ts

cycle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/**
22
* Returns an infinite iterable that cycles through the given iterable.
33
*
4-
* @param iterable The iterable to cycle.
4+
* @param iterable - The iterable to cycle.
55
* @returns The cycled iterable.
6+
* @see {@link module:iterutil/async/cycle.cycle} for the asynchronous version.
7+
* @see {@link module:iterutil/take.take} to take a specific number of elements from the iterable.
68
*
79
* @example
810
* ```ts

drop.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/**
22
* Drops the first `limit` items from the iterable.
33
*
4-
* It throws an error if `limit` is less than 0.
5-
*
6-
* @param iterable The iterable to drop items from.
7-
* @param limit The number of items to drop.
4+
* @param iterable - The iterable to drop items from.
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 the limit is not a safe integer or is negative.
8+
* @see {@link module:iterutil/async/drop.drop} for the asynchronous version.
9+
* @see {@link module:iterutil/drop-while.dropWhile} to drop elements while a predicate is true.
10+
* @see {@link module:iterutil/take.take} to take a specific number of elements from the iterable.
11+
* @see {@link module:iterutil/take-while.takeWhile} to take elements while a predicate is true.
912
*
1013
* @example
1114
* ```ts

drop_while.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/**
2-
* Drops elements from the iterable while the predicate returns true.
2+
* Drops elements from the iterable while the predicate function returns true.
33
*
44
* The first element that does not match the predicate is included in the output.
55
* If the predicate never returns false, the output will be an empty iterable.
66
*
7-
* @param iterable The iterable to drop elements from.
8-
* @param fn The predicate function to drop elements with.
7+
* @param iterable - The iterable to drop elements from.
8+
* @param fn - The predicate function to drop elements with.
99
* @returns The iterable with elements dropped while the predicate returns true.
10+
* @see {@link module:iterutil/async/drop-while.dropWhile} for the asynchronous version.
11+
* @see {@link module:iterutil/drop.drop} to drop a specific number of elements from the iterable.
12+
* @see {@link module:iterutil/take.take} to take a specific number of elements from the iterable.
13+
* @see {@link module:iterutil/take-while.takeWhile} to take elements while a predicate is true.
1014
*
1115
* @example
1216
* ```ts

enumerate.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
/**
22
* Enumerate an iterable.
33
*
4-
* @param iterable The iterable to enumerate.
5-
* @param start The starting index.
4+
* @param iterable - The iterable to enumerate.
5+
* @param start - The starting index.
66
* @returns An iterable of index-value pairs.
7+
* @see {@link module:iterutil/async/enumerate.enumerate} for the asynchronous version.
8+
* @see {@link module:iterutil/zipped.zipped} to zip multiple iterables together.
9+
* @see {@link module:iterutil/count.count} to generate an infinite sequence of numbers.
10+
* @see {@link module:iterutil/range.range} to generate a finite sequence of numbers.
711
*
812
* @example
913
* ```ts

every.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/**
22
* Returns true if every element in the iterable satisfies the provided testing function.
33
*
4-
* @param iterable The iterable to test.
5-
* @param fn The function to test with.
4+
* @param iterable - The iterable to test.
5+
* @param fn - The function to test with.
66
* @returns True if every element in the iterable satisfies the provided testing function, otherwise false.
7+
* @see {@link module:iterutil/async/every.every} for the asynchronous version.
8+
* @see {@link module:iterutil/some.some} to test if any element satisfies the testing function.
79
*
810
* @example
911
* ```ts

0 commit comments

Comments
 (0)