Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor helpers.filterNoMatchReason() to use FilterChains #1371

Closed
samayer12 opened this issue Oct 31, 2024 · 3 comments
Closed

Refactor helpers.filterNoMatchReason() to use FilterChains #1371

samayer12 opened this issue Oct 31, 2024 · 3 comments
Assignees

Comments

@samayer12
Copy link
Collaborator

Describe what should be investigated or refactored

helpers.ts's filterNoMatchReason() uses chained ternary expression to filter data. This is a very similar problem solved with FilterChains in shouldSkipRequest.ts. We should adopt a similar approach in this file to reduce complexity.

We'll know were done when the filterNoMatchReason() function does not flag on any linter warnings and makes a call to filterChain.execute() to process data.

Links to any relevant code

See description.

Additional context

N/A

@samayer12
Copy link
Collaborator Author

Related to #1248

@btlghrants
Copy link
Collaborator

Note to self: make sure that src/lib/helpers.ts complexity warnings go away after this!

@btlghrants btlghrants added this to the v0.39.0 milestone Nov 4, 2024
@btlghrants btlghrants moved this from 🆕 New to 🏗 In progress in Pepr Project Board Nov 4, 2024
@btlghrants btlghrants self-assigned this Nov 4, 2024
@btlghrants btlghrants moved this from 🏗 In progress to ✅ Done in Pepr Project Board Nov 6, 2024
@btlghrants btlghrants removed this from the v0.39.0 milestone Nov 6, 2024
@btlghrants
Copy link
Collaborator

OBE -- the FilterChain pattern impl was rolled back. Will readdress this refactor in the future, should it become necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants