Add alternative method to fetch user

This commit is contained in:
Cadence Fish
2020-02-03 02:24:14 +13:00
parent 96fa4758c0
commit 272f4b6e3b
10 changed files with 191 additions and 65 deletions

View File

@@ -34,6 +34,14 @@ class TtlCache {
return this.cache.has(key)
}
hasNotPromise(key) {
const has = this.has(key)
if (!has) return false
const value = this.get(key)
if (value instanceof Promise || (value.constructor && value.constructor.name === "Promise")) return false
return true
}
/**
* @param {string} key
*/