feat: new util "mergeQuery"#39
Merged
Merged
Conversation
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.
This pull request introduces a new
mergeQueryutility for merging Feathers query objects, along with several supporting helpers and improvements to existing utilities. The main focus is on providing robust, well-tested logic for combining and intersecting queries, handling logical operators ($and,$or), and deduplicating query branches. The changes also include enhancements to theaddToQueryutility and some minor re-exports for consistency.New query merging utilities
Added
mergeQueryutility and supporting helpers:merge-query.util.js: Main merge function for query objects with different merge modes.dedupeBranches,extractQueryFilters,hasConflict,logicalBranches,mergeQueryBodies: Internal helpers for branch deduplication, filter extraction, conflict detection, logical operator handling, and merging logic. All are well-tested and documented. [1] [2] [3] [4] [5]mergeQuery.Added
isEmptyObjectutility to check for plain empty objects, with tests. [1] [2]Improvements to existing utilities
addToQueryto flatten and deduplicate$andbranches when merging pure$andqueries, with new tests and updated documentation. [1] [2] [3]Module re-exports and housekeeping
src/utils/index.tsfor consistency and to include new utilities.src/hooks/index.tsandsrc/predicates/index.tsto ensure all hooks and predicates are properly re-exported. [1] [2]CI / Dev tooling
.claude/settings.jsonto echo the build exit code for improved CI diagnostics.