-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix(api): preserve order when merging semantic and fulltext results #2107
Conversation
7ad8413
to
4b696c6
Compare
4b696c6
to
1b55827
Compare
wait before merging, need more testing |
1b55827
to
48e6ccb
Compare
{} | ||
) | ||
); | ||
const removeDuplicate = (arr, predicate = predicateFn) => |
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.
On a vraiment besoin d'un flatMap
?
Juste un filter avec un some dedans ça me parait un peu plus explicite pour filtrer si on n'a pas de soucis de sous tableaux !
arr.filter(
(item, index) =>
!arr.some(
(subItem, subIndex) =>
subIndex < index && predicate(item) === predicate(subItem)
)
);
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.
filter is ok but I found the some
syntax very hard to read
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 basically the same than .find
imho
this PR
fix #2095, #2152