@thisisagile/easy-express
Version:
Straightforward library for building domain-driven microservice architectures
1 lines • 882 B
Source Map (JSON)
{"version":3,"sources":["../../src/types/NamespaceContext.ts"],"sourcesContent":["import { createNamespace } from 'cls-hooked';\nimport { BaseRequestContext } from '@thisisagile/easy';\n\nexport class NamespaceContext extends BaseRequestContext {\n protected readonly namespace = createNamespace('context');\n\n public get<T>(key: string): T {\n return this.namespace.get(key) as T;\n }\n\n public set<T>(key: string, value: T): T {\n return this.namespace.set(key, value);\n }\n\n public readonly create = (f: () => void): void => this.namespace.run(f);\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AAE5B,IAAM,mBAAN,cAA+B,mBAAmB;AAAA,EACpC,YAAY,gBAAgB,SAAS;AAAA,EAEjD,IAAO,KAAgB;AAC5B,WAAO,KAAK,UAAU,IAAI,GAAG;AAAA,EAC/B;AAAA,EAEO,IAAO,KAAa,OAAa;AACtC,WAAO,KAAK,UAAU,IAAI,KAAK,KAAK;AAAA,EACtC;AAAA,EAEgB,SAAS,CAAC,MAAwB,KAAK,UAAU,IAAI,CAAC;AACxE;","names":[]}