Skip to content

refactor(inspector): extract shared reset/activated logic in filters - #207

Open
clanzhang wants to merge 1 commit into
antfu:mainfrom
clanzhang:refactor/filters-redundant-code
Open

clanzhang wants to merge 1 commit into
antfu:mainfrom
clanzhang:refactor/filters-redundant-code

Conversation

@clanzhang

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #123

🧭 Context

In filters.ts, the select and exclude properties of the filters reactive object both contain duplicated reset and activated logic with identical structure — only the key array differs (FILTER_KEYS_SELECT vs FILTER_KEYS_EXCLUDES).

📚 Description

Extract the shared reset / activated logic into a createFilterGroup helper function, replacing the duplicated inline definitions.

Changes:

  • Added createFilterGroup(keys) helper that returns { reset, activated } for a given key array
  • Replaced inline select: { reset, activated } and exclude: { reset, activated } with createFilterGroup(FILTER_KEYS_SELECT) and createFilterGroup(FILTER_KEYS_EXCLUDES)
  • No behavior change — pure refactor

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/node-modules-inspector@207
npm i https://pkg.pr.new/node-modules-tools@207

commit: 90dc0f6

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.

Redundant code

1 participant