@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
1 lines • 1.75 kB
Source Map (JSON)
{"version":3,"file":"CacheModule.mjs","names":[],"sources":["../../../src/modules/cache/CacheModule.ts"],"sourcesContent":["import type { DependencyManager, Module } from '../../plugins'\nimport { CachedStorageService } from './CachedStorageService'\nimport type { CacheModuleConfigOptions } from './CacheModuleConfig'\n\nimport { CacheModuleConfig } from './CacheModuleConfig'\nimport { SingleContextLruCacheRepository } from './singleContextLruCache/SingleContextLruCacheRepository'\nimport { SingleContextStorageLruCache } from './singleContextLruCache/SingleContextStorageLruCache'\n\nexport type CacheModuleOptions = CacheModuleConfigOptions\n\nexport class CacheModule implements Module {\n public readonly config: CacheModuleConfig\n\n public constructor(config: CacheModuleOptions) {\n this.config = new CacheModuleConfig(config)\n }\n\n public register(dependencyManager: DependencyManager) {\n dependencyManager.registerInstance(CacheModuleConfig, this.config)\n\n // Allows us to use the `CachedStorageService` instead of the `StorageService`\n // This first checks the local cache to return a record\n if (this.config.useCachedStorageService) {\n dependencyManager.registerSingleton(CachedStorageService)\n }\n\n // Custom handling for when we're using the SingleContextStorageLruCache\n if (this.config.cache instanceof SingleContextStorageLruCache) {\n dependencyManager.registerSingleton(SingleContextLruCacheRepository)\n }\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,cAAb,MAA2C;CAGzC,AAAO,YAAY,QAA4B;AAC7C,OAAK,SAAS,IAAI,kBAAkB,OAAO;;CAG7C,AAAO,SAAS,mBAAsC;AACpD,oBAAkB,iBAAiB,mBAAmB,KAAK,OAAO;AAIlE,MAAI,KAAK,OAAO,wBACd,mBAAkB,kBAAkB,qBAAqB;AAI3D,MAAI,KAAK,OAAO,iBAAiB,6BAC/B,mBAAkB,kBAAkB,gCAAgC"}