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.0 to 1.2.1

4

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://keyv.js.org",
"version": "1.2.0",
"version": "1.2.1",
"main": "src/index.js",

@@ -54,3 +54,3 @@ "author": {

},
"gitHead": "f4e5470ed333a0bf2edabf03f28413fd0176cf51"
"gitHead": "974af9fd536e632cf9817d376ea8b592fd0cb6f3"
}

@@ -149,3 +149,3 @@ # @keyvhq/memoize [<img width="100" align="right" src="https://ghcdn.rawgit.org/microlinkhq/keyv/master/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv)

Type: `Number`<br/>
Type: `Number` or `Function`<br/>
Default: `undefined`

@@ -155,2 +155,4 @@

When you provide a function, the value will be passed as first argument.
##### ttl

@@ -157,0 +159,0 @@

@@ -22,3 +22,8 @@ 'use strict'

const ttl = typeof rawTtl === 'function' ? rawTtl : () => rawTtl
const staleTtl = typeof rawStaleTtl === 'number' ? rawStaleTtl : undefined
const staleTtl =
typeof rawStaleTtl === 'function'
? rawStaleTtl
: typeof rawStaleTtl === 'number'
? () => rawStaleTtl
: undefined
const pending = Object.create(null)

@@ -79,3 +84,3 @@

const isStale =
staleTtl !== undefined && hasExpires && ttlValue < staleTtl
staleTtl !== undefined && hasExpires && ttlValue < staleTtl(data.value)
const info = { hasValue, key, isExpired, isStale }

@@ -82,0 +87,0 @@ const done = value => (objectMode ? [value, info] : value)

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