@cacheable/node-cache
Advanced tools
+16
-16
@@ -514,2 +514,18 @@ "use strict"; | ||
| } | ||
| startInterval() { | ||
| if (this.options.checkperiod && this.options.checkperiod > 0) { | ||
| const checkPeriodinSeconds = this.options.checkperiod * 1e3; | ||
| this.intervalId = setInterval(() => { | ||
| this.checkData(); | ||
| }, checkPeriodinSeconds).unref(); | ||
| return; | ||
| } | ||
| this.intervalId = 0; | ||
| } | ||
| stopInterval() { | ||
| if (this.intervalId !== 0) { | ||
| clearInterval(this.intervalId); | ||
| this.intervalId = 0; | ||
| } | ||
| } | ||
| formatKey(key) { | ||
@@ -527,12 +543,2 @@ return key.toString(); | ||
| } | ||
| startInterval() { | ||
| if (this.options.checkperiod && this.options.checkperiod > 0) { | ||
| const checkPeriodinSeconds = this.options.checkperiod * 1e3; | ||
| this.intervalId = setInterval(() => { | ||
| this.checkData(); | ||
| }, checkPeriodinSeconds).unref(); | ||
| return; | ||
| } | ||
| this.intervalId = 0; | ||
| } | ||
| checkData() { | ||
@@ -548,8 +554,2 @@ for (const [key, value] of this.store.entries()) { | ||
| } | ||
| stopInterval() { | ||
| if (this.intervalId !== 0) { | ||
| clearInterval(this.intervalId); | ||
| this.intervalId = 0; | ||
| } | ||
| } | ||
| createError(errorCode, key) { | ||
@@ -556,0 +556,0 @@ let error = errorCode; |
+2
-2
@@ -327,7 +327,7 @@ import { Hookified } from 'hookified'; | ||
| getIntervalId(): number | NodeJS.Timeout; | ||
| startInterval(): void; | ||
| stopInterval(): void; | ||
| private formatKey; | ||
| private getExpirationTimestamp; | ||
| private startInterval; | ||
| private checkData; | ||
| private stopInterval; | ||
| private createError; | ||
@@ -334,0 +334,0 @@ } |
+2
-2
@@ -327,7 +327,7 @@ import { Hookified } from 'hookified'; | ||
| getIntervalId(): number | NodeJS.Timeout; | ||
| startInterval(): void; | ||
| stopInterval(): void; | ||
| private formatKey; | ||
| private getExpirationTimestamp; | ||
| private startInterval; | ||
| private checkData; | ||
| private stopInterval; | ||
| private createError; | ||
@@ -334,0 +334,0 @@ } |
+16
-16
@@ -487,2 +487,18 @@ // src/index.ts | ||
| } | ||
| startInterval() { | ||
| if (this.options.checkperiod && this.options.checkperiod > 0) { | ||
| const checkPeriodinSeconds = this.options.checkperiod * 1e3; | ||
| this.intervalId = setInterval(() => { | ||
| this.checkData(); | ||
| }, checkPeriodinSeconds).unref(); | ||
| return; | ||
| } | ||
| this.intervalId = 0; | ||
| } | ||
| stopInterval() { | ||
| if (this.intervalId !== 0) { | ||
| clearInterval(this.intervalId); | ||
| this.intervalId = 0; | ||
| } | ||
| } | ||
| formatKey(key) { | ||
@@ -500,12 +516,2 @@ return key.toString(); | ||
| } | ||
| startInterval() { | ||
| if (this.options.checkperiod && this.options.checkperiod > 0) { | ||
| const checkPeriodinSeconds = this.options.checkperiod * 1e3; | ||
| this.intervalId = setInterval(() => { | ||
| this.checkData(); | ||
| }, checkPeriodinSeconds).unref(); | ||
| return; | ||
| } | ||
| this.intervalId = 0; | ||
| } | ||
| checkData() { | ||
@@ -521,8 +527,2 @@ for (const [key, value] of this.store.entries()) { | ||
| } | ||
| stopInterval() { | ||
| if (this.intervalId !== 0) { | ||
| clearInterval(this.intervalId); | ||
| this.intervalId = 0; | ||
| } | ||
| } | ||
| createError(errorCode, key) { | ||
@@ -529,0 +529,0 @@ let error = errorCode; |
+18
-12
| { | ||
| "name": "@cacheable/node-cache", | ||
| "version": "1.7.5", | ||
| "version": "1.7.6", | ||
| "description": "Simple and Maintained fast NodeJS internal caching", | ||
| "type": "module", | ||
| "main": "./dist/index.cjs", | ||
| "main": "./dist/index.js", | ||
| "module": "./dist/index.js", | ||
@@ -11,4 +11,10 @@ "types": "./dist/index.d.ts", | ||
| ".": { | ||
| "require": "./dist/index.cjs", | ||
| "import": "./dist/index.js" | ||
| "import": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/index.d.cts", | ||
| "default": "./dist/index.cjs" | ||
| } | ||
| } | ||
@@ -38,15 +44,15 @@ }, | ||
| "devDependencies": { | ||
| "@biomejs/biome": "^2.3.5", | ||
| "@biomejs/biome": "^2.3.8", | ||
| "@faker-js/faker": "^10.1.0", | ||
| "@types/node": "^24.10.1", | ||
| "@vitest/coverage-v8": "^4.0.9", | ||
| "rimraf": "^6.1.0", | ||
| "@types/node": "^25.0.2", | ||
| "@vitest/coverage-v8": "^4.0.15", | ||
| "rimraf": "^6.1.2", | ||
| "tsup": "^8.5.1", | ||
| "typescript": "^5.9.3", | ||
| "vitest": "^4.0.9" | ||
| "vitest": "^4.0.15" | ||
| }, | ||
| "dependencies": { | ||
| "hookified": "^1.13.0", | ||
| "keyv": "^5.5.4", | ||
| "cacheable": "^2.2.0" | ||
| "hookified": "^1.14.0", | ||
| "keyv": "^5.5.5", | ||
| "cacheable": "^2.3.1" | ||
| }, | ||
@@ -53,0 +59,0 @@ "files": [ |
74499
0.18%Updated
Updated
Updated