Don't cache when cacheTimeMs is NaN

This commit is contained in:
Ajay Ramachandran
2020-10-15 11:33:47 -04:00
parent d6ca579495
commit 0a72a64489

View File

@@ -1,4 +1,6 @@
module.exports = function createMemoryCache(memoryFn, cacheTimeMs) {
if (isNaN(cacheTimeMs)) cacheTimeMs = 0;
// holds the promise results
const cache = new Map();
// holds the promises that are not fulfilled