Skip to content

feat: new util "mergeQuery"#39

Merged
fratzinger merged 1 commit into
mainfrom
feat/new-util-mergeQuery
Jun 26, 2026
Merged

feat: new util "mergeQuery"#39
fratzinger merged 1 commit into
mainfrom
feat/new-util-mergeQuery

Conversation

@fratzinger

Copy link
Copy Markdown
Member

This pull request introduces a new mergeQuery utility 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 the addToQuery utility and some minor re-exports for consistency.

New query merging utilities

  • Added mergeQuery utility 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]
    • Added a markdown documentation file for mergeQuery.
  • Added isEmptyObject utility to check for plain empty objects, with tests. [1] [2]

Improvements to existing utilities

  • Enhanced addToQuery to flatten and deduplicate $and branches when merging pure $and queries, with new tests and updated documentation. [1] [2] [3]

Module re-exports and housekeeping

  • Cleaned up and alphabetized exports in src/utils/index.ts for consistency and to include new utilities.
  • Fixed export order in src/hooks/index.ts and src/predicates/index.ts to ensure all hooks and predicates are properly re-exported. [1] [2]

CI / Dev tooling

  • Added a new build step to .claude/settings.json to echo the build exit code for improved CI diagnostics.

@fratzinger
fratzinger merged commit c53596c into main Jun 26, 2026
9 checks passed
@fratzinger
fratzinger deleted the feat/new-util-mergeQuery branch June 26, 2026 11:06
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.

1 participant