Skip to content

Commit

Permalink
Deduplicate matches for OctoLinker API only (OctoLinker#811)
Browse files Browse the repository at this point in the history
* Deduplicate matches for OctoLinker API only

* Expanding a diff seems to be not working for e2e tests
  • Loading branch information
stefanbuck authored Feb 3, 2020
1 parent 021b7b5 commit 5e2f6a3
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/core/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ function injectLiveDemoUrl(url) {
}

function groupMatchesByType(matches) {
const flattenUrls = removeDuplicates(
[].concat(
...matches.map(match =>
match.urls.map(url => ({
...url,
link: match.link,
})),
),
const flattenUrls = [].concat(
...matches.map(match =>
match.urls.map(url => ({
...url,
link: match.link,
})),
),
);

const apiItems = flattenUrls.filter(({ type }) =>
const apiItems = removeDuplicates(flattenUrls).filter(({ type }) =>
['registry', 'ping'].includes(type),
);

Expand Down

0 comments on commit 5e2f6a3

Please sign in to comment.