@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.58 kB
Source Map (JSON)
{"version":3,"file":"SingleContextLruCacheRecord.mjs","names":[],"sources":["../../../../src/modules/cache/singleContextLruCache/SingleContextLruCacheRecord.ts"],"sourcesContent":["import { Type } from 'class-transformer'\nimport type { TagsBase } from '../../../storage/BaseRecord'\n\nimport { BaseRecord } from '../../../storage/BaseRecord'\nimport { uuid } from '../../../utils/uuid'\n\nexport interface SingleContextLruCacheItem {\n value: unknown\n expiresAt?: number\n}\n\nexport interface SingleContextLruCacheProps {\n id?: string\n createdAt?: Date\n tags?: TagsBase\n\n entries: Map<string, SingleContextLruCacheItem>\n}\n\nexport class SingleContextLruCacheRecord extends BaseRecord {\n @Type(() => Object)\n public entries!: Map<string, SingleContextLruCacheItem>\n\n public static readonly type = 'SingleContextLruCacheRecord'\n public readonly type = SingleContextLruCacheRecord.type\n\n public constructor(props: SingleContextLruCacheProps) {\n super()\n\n if (props) {\n this.id = props.id ?? uuid()\n this.createdAt = props.createdAt ?? new Date()\n this.entries = props.entries\n this._tags = props.tags ?? {}\n }\n }\n\n public getTags() {\n return {\n ...this._tags,\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAmBA,IAAa,8BAAb,MAAa,oCAAoC,WAAW;CAO1D,AAAO,YAAY,OAAmC;AACpD,SAAO;OAHO,OAAO,4BAA4B;AAKjD,MAAI,OAAO;AACT,QAAK,KAAK,MAAM,MAAM,MAAM;AAC5B,QAAK,YAAY,MAAM,6BAAa,IAAI,MAAM;AAC9C,QAAK,UAAU,MAAM;AACrB,QAAK,QAAQ,MAAM,QAAQ,EAAE;;;CAIjC,AAAO,UAAU;AACf,SAAO,EACL,GAAG,KAAK,OACT;;;4BAjBoB,OAAO;YAH7B,WAAW,OAAO"}