-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Lint and update dependencies #253
Conversation
source/lib/repositories-service.js
Outdated
tree[owner] = Object.assign(tree[owner] || {}, { | ||
[repository]: Boolean(stored && stored[owner] && stored[owner][repository]) | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.reduce brought us to do unspeakable things
tree[owner] = Object.assign(tree[owner] || {}, { | |
[repository]: Boolean(stored && stored[owner] && stored[owner][repository]) | |
}); | |
tree[owner] = tree[owner] || {}; | |
tree[owner][repository] = Boolean(stored && stored[owner] && stored[owner][repository]); |
Or this?
tree[owner] = Object.assign(tree[owner] || {}, { | |
[repository]: Boolean(stored && stored[owner] && stored[owner][repository]) | |
}); | |
tree[owner] = tree[owner] || {}; | |
tree[owner][repository] = Boolean(stored?.[owner]?.[repository]); |
Reading the code, however, it seems that this code is wrong in many parts. stored
is never null nor empty since it gets the default options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll have to be done separately because this branch is on Node 11
Non-red already means valid
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Will help fix #251
Follows and is based on #252
Untested but it looks equivalent