Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@keyvhq/memoize

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keyvhq/memoize - npm Package Compare versions

Comparing version 1.2.6 to 1.2.7

10

package.json

@@ -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"
}

17

src/index.js

@@ -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 => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc