New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

appolo-cache

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appolo-cache - npm Package Compare versions

Comparing version 6.0.7 to 6.0.8

benchmark/index.js.map

13

lib/cache.js

@@ -24,9 +24,9 @@ "use strict";

}
getByExpire(key, expire) {
return this._getByExpire(key, expire, "getItem");
getByExpire(key, expire, refresh) {
return this._getByExpire(key, expire, refresh, "getItem");
}
peekByExpire(key, expire) {
return this._getByExpire(key, expire, "peekItem");
peekByExpire(key, expire, refresh) {
return this._getByExpire(key, expire, refresh, "peekItem");
}
_getByExpire(key, expire, action) {
_getByExpire(key, expire, refresh, action) {
let item = this[action](key);

@@ -37,6 +37,7 @@ if (item === null) {

expire = expire || item.maxAge;
refresh = refresh || (expire / 2);
let ttl = item.ttl;
let dto = {
value: item.value,
validExpire: ttl >= (expire / 2)
validExpire: ttl >= refresh
};

@@ -43,0 +44,0 @@ if (!dto.validExpire) {

@@ -21,3 +21,3 @@ {

"main": "./index.js",
"version": "6.0.7",
"version": "6.0.8",
"license": "MIT",

@@ -24,0 +24,0 @@ "repository": {

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