Skip to content

Commit

Permalink
Intersect search results [Fix #131]
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Oct 6, 2017
1 parent b0e1d44 commit 57cc2ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/emoji-index.js
@@ -1,5 +1,5 @@
import data from '../data'
import { getData, getSanitizedData, uniq } from '.'
import { getData, getSanitizedData, intersect } from '.'

var originalPool = {}
var index = {}
Expand Down Expand Up @@ -130,7 +130,7 @@ function search(value, { emojisToShowFilter, maxResults, include, exclude, custo
}).filter(a => a)

if (allResults.length > 1) {
results = uniq(allResults)
results = intersect.apply(null, allResults)
} else if (allResults.length) {
results = allResults[0]
} else {
Expand Down

0 comments on commit 57cc2ea

Please sign in to comment.