Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the filter utility and adds comprehensive tests for filtering functions while revising the documentation to reflect the changes.
- Updated the getKeyValue import path in tests/value.test.ts.
- Added new tests for filterByKeyValue in tests/filter.test.ts covering various filter scenarios.
- Introduced a runtime check for the first argument in filterByKeyValue and updated the README formatting.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/value.test.ts | Updated import for getKeyValue to point to the new module location. |
| tests/filter.test.ts | Added extensive tests for the filterByKeyValue utility function. |
| lib/utils/filter.ts | Added runtime type checking for the list parameter and refined filter logic. |
| README.md | Revised documentation and formatting for clarity. |
Comments suppressed due to low confidence (2)
tests/value.test.ts:3
- Verify that the updated import path for getKeyValue correctly reflects the intended module relocation and that all related dependencies are updated accordingly.
import { getKeyValue } from '../lib/utils/value';
lib/utils/filter.ts:25
- [nitpick] Since list is statically typed as an array, consider whether this runtime type check is necessary; if unexpected types might be passed, throwing an error could improve clarity and maintainability.
if (!Array.isArray(list)) {
…lue function; implement tests for filterByKeyValue and getKeyValue functions
…terByKeyValue function when the first argument is not an array
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Filter Utility by revising import paths, adding comprehensive tests, and adjusting export paths and documentation to better reflect the current TypeScript implementation.
- Updated getKeyValue import in tests to use the new utility path.
- Added extensive test cases for filterByKeyValue in tests/filter.test.ts.
- Modified package.json and README.md to reflect the new library structure and exports.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/value.test.ts | Updated the getKeyValue import to point to the new utility module. |
| tests/filter.test.ts | Added new tests covering various filterByKeyValue scenarios. |
| package.json | Revised export paths and files list to use the new lib folder. |
| lib/utils/filter.ts | Adjusted strict mode logic for filterByKeyValue for non-array values. |
| README.md | Updated documentation to align with the library restructuring. |
Comments suppressed due to low confidence (1)
package.json:30
- Verify that updating the export paths from built files to source TypeScript files is intentional and will not disrupt package consumers who rely on the previous distribution format.
"default": "./lib/index.ts",
…e function to ensure the first argument is an array; adjust package.json and tsconfig.json for proper module exports and compilation settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.