Repository navigation
feat: advanced array fn - #5
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces several new advanced array functions and renames an existing function to improve API consistency. Key changes include:
- Renaming the "group" function to "groupBy" and updating corresponding references.
- Adding new utility functions: uniq, pluck, sortBy, and partition with tests.
- Updating the Fx class to integrate these new functions.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/array/uniq.ts | Implements the uniq function to return unique elements from an iterable. |
| src/array/uniq.spec.ts | Provides tests to verify the behavior of the uniq function. |
| src/array/sortBy.ts | Implements the sortBy function for sorting iterables with an optional comparator. |
| src/array/sortBy.spec.ts | Provides tests to verify correct sorting of numbers and objects. |
| src/array/pluck.ts | Implements a pluck generator to extract specified property values from objects. |
| src/array/pluck.spec.ts | Provides tests to validate the pluck function's correct extraction behavior. |
| src/array/partition.ts | Implements partition to split iterables based on a predicate function. |
| src/array/partition.spec.ts | Provides tests to verify proper partitioning of elements. |
| src/array/index.ts | Updates module exports to include new functions and the renamed groupBy. |
| src/array/groupBy.ts | Renames the function from group to groupBy to clarify intent. |
| src/array/groupBy.spec.ts | Updates tests to use groupBy instead of group. |
| src/Fx.ts | Updates the Fx class to integrate advanced array functions (groupBy, pluck, etc.). |
| src/Fx.spec.ts | Adds tests to ensure the new Fx methods work as intended. |
|
🟢 Test coverage unchanged: 100% |
|
🟢 Test coverage unchanged: 100% |
There was a problem hiding this comment.
Pull Request Overview
This pull request enhances the array utilities with new functions and renames an existing grouping function for improved clarity. Key changes include the addition of uniq, sortBy, pluck, partition functions (and their corresponding tests), as well as renaming group to groupBy in both the implementation and test files.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/array/uniq.ts | Added uniq function implementation |
| src/array/uniq.spec.ts | Added tests for uniq functionality |
| src/array/sortBy.ts | Added sortBy function implementation |
| src/array/sortBy.spec.ts | Added tests for sortBy functionality |
| src/array/pluck.ts | Added pluck generator function implementation |
| src/array/pluck.spec.ts | Added tests for pluck functionality |
| src/array/partition.ts | Added partition function implementation |
| src/array/partition.spec.ts | Added tests for partition functionality |
| src/array/index.ts | Updated exports to use groupBy and include new functions |
| src/array/groupBy.ts | Renamed and updated group function to groupBy |
| src/array/groupBy.spec.ts | Updated tests to reflect groupBy renaming |
| src/array/chunk.ts | Updated signature with explicit generator return types |
| src/Fx.ts | Enhanced the Fx class with new array methods and updated group to groupBy |
| src/Fx.spec.ts | Added tests covering new Fx methods (sort, partition, pluck, uniq) |
|
🟢 Test coverage unchanged: 100% |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the array utility module by renaming the group function to groupBy and adding new functions (pluck, scan, sortBy, uniq), along with corresponding tests and updated integration within the Fx class.
- Renamed group to groupBy and updated related exports and tests.
- Added functions: pluck, sortBy, uniq, and partition with tests.
- Updated the Fx class to leverage the new array utilities for chaining.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/array/uniq.ts | Added uniq function for returning unique array elements. |
| src/array/uniq.spec.ts | Tests for the uniq function. |
| src/array/sortBy.ts | Added sortBy function to sort elements from an iterable. |
| src/array/sortBy.spec.ts | Tests for the sortBy function. |
| src/array/pluck.ts | Added pluck generator function to extract property values. |
| src/array/pluck.spec.ts | Tests for the pluck function. |
| src/array/partition.ts | Added partition function to divide an iterable based on a predicate. |
| src/array/partition.spec.ts | Tests for the partition function. |
| src/array/index.ts | Updated exports: replaced group with groupBy and added new functions. |
| src/array/groupBy.ts | Renamed and updated group function to groupBy with minimal changes. |
| src/array/groupBy.spec.ts | Updated tests to use groupBy instead of group. |
| src/array/chunk.ts | Updated generator signature for the chunk function. |
| src/Fx.ts | Refactored Fx class to use the new array functions, replacing cloneWith methods with Fx.of for improved chaining. |
| src/Fx.spec.ts | Added tests for new methods in Fx: sort, uniq, partition, and pluck. |
close: #6
FIX
FEAT