Commit 34487543f9395ea3b57b0a979b970a0ee5204e24

Authored by Adhidarma Hadiwinoto
1 parent 55683feadb
Exists in master

Fix matchedApikey returning object

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

lib/is-valid-apikey.js
... ... @@ -3,7 +3,7 @@ module.exports = (apikey, apikeys) => {
3 3 if (typeof apikey !== 'string') return false;
4 4 if (!apikeys || !Array.isArray(apikeys)) return false;
5 5  
6   - const matchedApikey = !!apikeys.find((item) => !item.disabled
  6 + const matchedApikey = apikeys.find((item) => !item.disabled
7 7 && (
8 8 (typeof item === 'string' && item === apikey)
9 9 || (item.value === apikey)