fast-ttl-cache 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ export default class FastTTLCache {
26
26
  * @param key 缓存键
27
27
  * @returns 如果缓存存在且未过期返回值,否则返回null
28
28
  */
29
- getToken(key: string): any | null;
29
+ get(key: string): any | null;
30
30
  /**
31
31
  * 设置缓存,包含已存在或新增
32
32
  * @param key 缓存键
package/dist/index.js CHANGED
@@ -65,7 +65,7 @@ var FastTTLCache = class {
65
65
  * @param key 缓存键
66
66
  * @returns 如果缓存存在且未过期返回值,否则返回null
67
67
  */
68
- getToken(key) {
68
+ get(key) {
69
69
  const item = this.store.get(key);
70
70
  if (!item) return null;
71
71
  if (Date.now() - item.time > this.ttl) {
package/dist/index.mjs CHANGED
@@ -42,7 +42,7 @@ var FastTTLCache = class {
42
42
  * @param key 缓存键
43
43
  * @returns 如果缓存存在且未过期返回值,否则返回null
44
44
  */
45
- getToken(key) {
45
+ get(key) {
46
46
  const item = this.store.get(key);
47
47
  if (!item) return null;
48
48
  if (Date.now() - item.time > this.ttl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-ttl-cache",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "ttl cache with capacity support use no timer",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",