Socket
Socket
Sign inDemoInstall

quick-lru

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.1 to 6.0.2

10

index.js

@@ -113,10 +113,14 @@ export default class QuickLRU {

set(key, value, {maxAge = this.maxAge === Number.POSITIVE_INFINITY ? undefined : Date.now() + this.maxAge} = {}) {
set(key, value, {maxAge = this.maxAge} = {}) {
const expiry =
typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ?
Date.now() + maxAge :
undefined;
if (this.cache.has(key)) {
this.cache.set(key, {
value,
expiry: maxAge
expiry
});
} else {
this._set(key, {value, expiry: maxAge});
this._set(key, {value, expiry});
}

@@ -123,0 +127,0 @@ }

{
"name": "quick-lru",
"version": "6.0.1",
"version": "6.0.2",
"description": "Simple “Least Recently Used” (LRU) cache",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc