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

TS fix: find,filter,navigate in storage #206

Merged
merged 6 commits into from
Sep 5, 2024

Conversation

xmok
Copy link
Contributor

@xmok xmok commented Sep 4, 2024

I'm not sure if the return type of navigate is correct - could anyone verify?

types/cjs.d.ts Outdated Show resolved Hide resolved
types/es.d.ts Outdated Show resolved Hide resolved
types/cjs.d.ts Outdated Show resolved Hide resolved
@xmok
Copy link
Contributor Author

xmok commented Sep 4, 2024

OK finally 🫠.

  • filter returns MutableFile since it's using reduce with an array so it will always be an array which I'm assuming is MutableFile?
  • find returns MutableFile | null since it's reduce with a null so could be undefined then null i.e. null
  • navigate returns MutableFile | undefined due to the reduce

@@ -470,7 +470,7 @@ class File extends EventEmitter {
}, [])
}

navigate (query, deep) {
navigate (query) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm amazed the linter didn't caught that.

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.

2 participants