From c7eb7cd95d78077e486317c5c711e7d0688507dd Mon Sep 17 00:00:00 2001 From: exuanbo Date: Mon, 11 May 2020 10:57:46 +0800 Subject: [PATCH] fix: does not return after resolve match --- lib/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index b38335d..79824b2 100644 --- a/lib/main.js +++ b/lib/main.js @@ -11,7 +11,7 @@ const db = require('./icons/icon-tables.js') const bestMatch = name => new Promise((resolve, reject) => { if (name.endsWith('/')) { - resolve(db.matchName(name.slice(0, -1), true)) + return resolve(db.matchName(name.slice(0, -1), true)) } const matches = [ @@ -27,7 +27,7 @@ const bestMatch = name => const matchCount = matched.length if (matchCount) { if (matchCount > 1) matched.sort((a, b) => b.priority - a.priority) - resolve(matched[0]) + return resolve(matched[0]) } resolve(null) })