-
Notifications
You must be signed in to change notification settings - Fork 136
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
Combine suggester restuls. #2681
Combine suggester restuls. #2681
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2681 +/- ##
==========================================
+ Coverage 52.32% 57.21% +4.89%
==========================================
Files 95 95
Lines 2515 2861 +346
Branches 456 588 +132
==========================================
+ Hits 1316 1637 +321
- Misses 827 1223 +396
+ Partials 372 1 -371
|
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.
Looking good, just 2 styling issues.
function parseSuggestions(suggestions: SearchAutoSuggestionResultItem[] = []) { | ||
return suggestions.map((suggestion) => { | ||
const [allTitle, bundleTitle, abstract] = suggestion.term.split(AUTOSUGGEST_TERM_DELIMITER); | ||
const url = new URL(suggestion.payload); |
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.
Wouldn't it be better to directly destruct the pathname
here? const { pathname} = ...
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's a class, not an object. Destructing classes might be dangerous.
const [allTitle, bundleTitle, abstract] = suggestion.term.split(AUTOSUGGEST_TERM_DELIMITER); | ||
const url = new URL(suggestion.payload); | ||
const pathname = url.pathname; | ||
const item = { |
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.
Is there specific reason to assign this to a const instead of directly constructing it when returning value?
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.
None apart from better readability.
9c26a73
to
a1f645d
Compare
a1f645d
to
f10f1f7
Compare
Combine results of the default and the improved suggester results.