Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
PfisterFactor committed Mar 27, 2024
1 parent 49cf22e commit 414b4a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/cache/Cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import RedisCacheEngine from './engine/RedisCacheEngine'
class CacheEngine {
#engine!: ICacheEngine
#defaultTTL: number
#debug: boolean;
#debug: boolean
readonly #engines = ['memory', 'redis'] as const

constructor(cacheOptions: ICacheOptions) {
Expand Down Expand Up @@ -38,7 +38,7 @@ class CacheEngine {
async get(key: string): Promise<IData> {
const cacheEntry = await this.#engine.get(key)
if (this.#debug) {
const cacheHit = (cacheEntry != undefined) ? "HIT" : "MISS"
const cacheHit = (cacheEntry != undefined) ? 'HIT' : 'MISS'
console.log(`[ts-cache-mongoose] GET '${key}' - ${cacheHit}`)
}
return cacheEntry
Expand All @@ -50,7 +50,6 @@ class CacheEngine {
if (this.#debug) {
console.log(`[ts-cache-mongoose] SET '${key}' - ttl: ${actualTTL} ms`)

Check failure on line 51 in src/cache/Cache.ts

View workflow job for this annotation

GitHub Actions / Coverage & Sonar (20.x)

Invalid type "number" of template literal expression
}

}

async del(key: string): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/ICacheOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface ICacheOptions {
engine: 'memory' | 'redis'
engineOptions?: RedisOptions
defaultTTL?: string
debug?: boolean;
debug?: boolean
}

export default ICacheOptions

0 comments on commit 414b4a5

Please sign in to comment.