Skip to content

Commit

Permalink
Apply fuzzy search also on the emoji name.
Browse files Browse the repository at this point in the history
Before, only keywords where fuzzy searched.
  • Loading branch information
Peter Kaske committed Sep 30, 2016
1 parent 22820f0 commit 56bf53c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/search.js
Expand Up @@ -15,7 +15,7 @@ function search (keywords, options, cb) {
emoji.weight = intersectionWith(emoji.keywords, keywords, function (keyword, term) {
return options.fuzzy ? fuzzy(term, keyword) : term === keyword
}).length * -1
if (keywords.length === 1 && keywords[0] === name) emoji.weight = -9999
if (keywords.length === 1 && (options.fuzzy ? fuzzy(keywords[0], name) : keywords[0] === name)) emoji.weight = -9999
if (emoji.weight === 0) return false
return true
})
Expand Down

0 comments on commit 56bf53c

Please sign in to comment.