Huge News!Announcing our $40M Series B led by Abstract Ventures.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.6 to 6.0.7

15

lib/cache.ts

@@ -40,11 +40,11 @@ import {ListItem} from "./listItem";

public getByExpire(key: K, expire?: number): { value: T, validExpire: boolean } {
return this._getByExpire(key, expire, "getItem");
public getByExpire(key: K, expire?: number, refresh?: number): { value: T, validExpire: boolean } {
return this._getByExpire(key, expire, refresh, "getItem");
}
public peekByExpire(key: K, expire?: number): { value: T, validExpire: boolean } {
return this._getByExpire(key, expire, "peekItem");
public peekByExpire(key: K, expire?: number, refresh?: number): { value: T, validExpire: boolean } {
return this._getByExpire(key, expire, refresh, "peekItem");
}
private _getByExpire(key: K, expire: number, action: "peekItem" | "getItem"): { value: T, validExpire: boolean } {
private _getByExpire(key: K, expire: number, refresh: number, action: "peekItem" | "getItem"): { value: T, validExpire: boolean } {
let item = this[action](key);

@@ -57,2 +57,3 @@

expire = expire || item.maxAge;
refresh = refresh || (expire / 2)

@@ -63,3 +64,3 @@ let ttl = item.ttl;

value: item.value,
validExpire: ttl >= (expire / 2)
validExpire: ttl >= refresh
};

@@ -310,2 +311,2 @@

}
}

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

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

@@ -33,11 +33,11 @@ "repository": {

"@types/benchmark": "^1.0.31",
"@types/chai": "^4.1.2",
"@types/mocha": "^5.0.0",
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
"benchmark": "^2.1.4",
"chai": "^4.1.2",
"lru-cache": "^4.1.2",
"mocha": "^5.0.5",
"chai": "^4.2.0",
"lru-cache": "^5.1.1",
"mocha": "^7.1.2",
"simple-lru-cache": "0.0.2",
"typescript": "^2.8.1"
"typescript": "^3.8.3"
}
}
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