@digitalbazaar/lru-memoize
Advanced tools
Comparing version 3.0.1 to 3.0.2
/*! | ||
* 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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6311
83