@travetto/cache
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-beta.7
@@ -40,4 +40,4 @@ { | ||
}, | ||
"version": "1.0.0-beta.6", | ||
"gitHead": "5b2a36d2c958c639de2afba9be10858e3ce6c26c" | ||
"version": "1.0.0-beta.7", | ||
"gitHead": "c7b05ae030aab28c52b83c27bf5bb9f047226231" | ||
} |
@@ -5,10 +5,10 @@ import { CacheConfig, CoreCacheConfig } from './types'; | ||
export class CacheUtil { | ||
static generateKey(cache: CacheStore, config: CoreCacheConfig, params: any[]) { | ||
static generateKey(config: CoreCacheConfig, cache: CacheStore, params: any[]) { | ||
const input = config.params ? config.params(params) : params; | ||
const keyParams = config.key ? config.key(...input) : input; | ||
return cache.computeKey(keyParams); | ||
return `${config.keySpace!}::${cache.computeKey(keyParams)}`; | ||
} | ||
static async cache(config: CacheConfig, cache: CacheStore, target: any, fn: Function, params: any[]) { | ||
const key = this.generateKey(cache, config, params); | ||
const key = this.generateKey(config, cache, params); | ||
@@ -15,0 +15,0 @@ let res = await cache.getOptional(config, key); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26225