Intersect search results [Fix #131]

nolan/hinaloe-test
Etienne Lemay 2017-10-06 17:23:04 -04:00
parent b0e1d44d6e
commit 57cc2ea4a5
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import data from '../data'
import { getData, getSanitizedData, uniq } from '.'
import { getData, getSanitizedData, intersect } from '.'
var originalPool = {}
var index = {}
@ -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 {