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(cache): further condense walkTree #393

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

agilgur5
Copy link
Collaborator

Summary

Condense walkTree further to just 4 LoC

Details

  • forEach returns void, so we can just return it and condense the if a bit

- `forEach` returns `void`, so we can just `return` it and condense the `if` a bit
@agilgur5 agilgur5 added kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs scope: cache Related to the cache labels Jul 22, 2022
@ezolenko
Copy link
Owner

ezolenko commented Aug 8, 2022

Feels weird to return void, but I guess TS will warn if return types ever get out of sync 🤷

@ezolenko ezolenko merged commit bbed47e into ezolenko:master Aug 8, 2022
@agilgur5
Copy link
Collaborator Author

agilgur5 commented Aug 8, 2022

Yea it's a stylistic thing; I thought it seemed odd in the context of this codebase but I've written code like this in other codebases where it doesn't seem as "out of place".
Changing some of the style in this and #402 should make it feel more comfortable.

Should probably get prettier (or another formatter) into this codebase at some point to make everything more consistent (and switch to non-deprecated ESLint too 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs scope: cache Related to the cache
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants