Skip to content

Modernize query planner: use Object.values instead of manual mapping#9174

Open
MOHITKOURAV01 wants to merge 1 commit intoapache:masterfrom
MOHITKOURAV01:modernize-query-planner
Open

Modernize query planner: use Object.values instead of manual mapping#9174
MOHITKOURAV01 wants to merge 1 commit intoapache:masterfrom
MOHITKOURAV01:modernize-query-planner

Conversation

@MOHITKOURAV01
Copy link

Modernize Query Planner: Replace manual mapping with Object.values

This PR modernizes the shouldShortCircuit function in the pouchdb-find query planner. It resolves a legacy @todo comment by replacing a manual iteration over Object.keys with the native Object.values() method.

Rationale

  • Code Clarity: Object.values() is more concise and directly expresses the intent of gathering all selector values.
  • Modern Standards: The codebase already uses Object.values() in other core modules, making this change consistent with current project standards.
  • Tech Debt: Removes an old Node.js v6 compatibility workaround that is no longer necessary.

Changes

  • Modified packages/node_modules/pouchdb-find/src/adapters/local/find/query-planner.js
  • Removed legacy @todo regarding Node.js v6 support.
  • Updated shouldShortCircuit to use Object.values(selector).

Testing Conducted

  • Ran npm run test-unit (164/164 passing).
  • Ran specialized find tests using TYPE=find ADAPTERS=memory (349/349 passing).
  • Verified successful build via npm run build.

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