Skip to content

feat: advanced array fn - #5

Merged
99mini merged 6 commits into
mainfrom
feature/advanced-array-fn
Apr 27, 2025
Merged

99mini merged 6 commits into
mainfrom
feature/advanced-array-fn

Conversation

@99mini

@99mini 99mini commented Apr 24, 2025 •

Copy link
Copy Markdown
Owner

close: #6

FIX

  • rename group to groupBy

FEAT

  • pluck
  • scan
  • sortBy
  • uniq

@99mini
99mini requested a review from Copilot April 24, 2025 00:37
@99mini 99mini self-assigned this Apr 24, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 Test coverage unchanged: 100%

@github-actions

Copy link
Copy Markdown
Contributor

🟢 Test coverage unchanged: 100%

@99mini
99mini requested a review from Copilot April 27, 2025 04:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread src/Fx.ts Resolved
@99mini
99mini requested a review from Copilot April 27, 2025 04:10
@github-actions

Copy link
Copy Markdown
Contributor

🟢 Test coverage unchanged: 100%

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@99mini
99mini merged commit adf6734 into main Apr 27, 2025
@99mini
99mini deleted the feature/advanced-array-fn branch April 27, 2025 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 고급 동기 배열 함수 구현

2 participants