@keyvhq/memoize
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://keyv.js.org", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"main": "src/index.js", | ||
@@ -31,6 +31,4 @@ "author": { | ||
"dependencies": { | ||
"@keyvhq/core": "^1.2.6", | ||
"json-buffer": "^3.0.0", | ||
"mimic-fn": "~3.0.0", | ||
"p-any": "~2.1.0" | ||
"@keyvhq/core": "~1.2.6", | ||
"mimic-fn": "~3.0.0" | ||
}, | ||
@@ -55,3 +53,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "091662833e9ce9def9acbd8d89c9d070a9d0983c" | ||
"gitHead": "dbc227f53ec5ced6b40bf25b58ee308334cab276" | ||
} |
@@ -5,3 +5,2 @@ 'use strict' | ||
const mimicFn = require('mimic-fn') | ||
const pAny = require('p-any') | ||
@@ -49,14 +48,2 @@ const isFunction = input => typeof input === 'function' | ||
* @param {string} key | ||
* @return {Promise<*>} value | ||
* @throws if not found | ||
*/ | ||
function getStoredValue (key) { | ||
return getRaw(key).then(data => { | ||
if (!data || isUndefined(data)) throw new Error('Not found') | ||
return data.value | ||
}) | ||
} | ||
/** | ||
* @param {string} key | ||
* @param {*} value | ||
@@ -78,5 +65,3 @@ * @return {Promise} resolves when updated | ||
if (!isUndefined(pending[key])) { | ||
return pAny([getStoredValue(key), pending[key]]) | ||
} | ||
if (!isUndefined(pending[key])) return pending[key] | ||
@@ -83,0 +68,0 @@ pending[key] = getRaw(key).then(async data => { |
2
10211
96
+ Added@keyvhq/core@1.2.6(transitive)
- Removedjson-buffer@^3.0.0
- Removedp-any@~2.1.0
- Removed@keyvhq/core@1.6.26(transitive)
- Removedaggregate-error@3.1.0(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedp-any@2.1.0(transitive)
- Removedp-cancelable@2.1.1(transitive)
- Removedp-some@4.1.0(transitive)
- Removedtype-fest@0.3.1(transitive)
Updated@keyvhq/core@~1.2.6