Socket
Socket
Sign inDemoInstall

@digitalbazaar/lru-memoize

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalbazaar/lru-memoize - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

11

lib/LruCache.js
/*!
* Copyright (c) 2020-2021 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved.
*/

@@ -72,8 +72,11 @@ import LRU from 'lru-cache';

} catch(e) {
// if the promise rejects, delete it
this.cache.del(key);
// if the promise rejects, delete it if the cache entry hasn't changed
if(promise === this.cache.get(key)) {
this.cache.del(key);
}
throw e;
}
if(cacheOptions.disposeOnSettle) {
// dispose promise once settled (provided the cache entry hasn't changed)
if(cacheOptions.disposeOnSettle && promise === this.cache.get(key)) {
this.cache.del(key);

@@ -80,0 +83,0 @@ }

{
"name": "@digitalbazaar/lru-memoize",
"version": "3.0.1",
"version": "3.0.2",
"description": "LRU Memoize",

@@ -28,6 +28,6 @@ "license": "BSD-3-Clause",

"delay": "^5.0.0",
"eslint": "^8.16.0",
"eslint-config-digitalbazaar": "^3.0.0",
"eslint-plugin-jsdoc": "^39.3.2",
"eslint-plugin-unicorn": "^42.0.0",
"eslint": "^8.48.0",
"eslint-config-digitalbazaar": "^5.0.1",
"eslint-plugin-jsdoc": "^46.5.0",
"eslint-plugin-unicorn": "^48.0.1",
"karma": "^6.3.20",

@@ -34,0 +34,0 @@ "karma-chai": "^0.1.0",

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