@thisisagile/easy
Version:
Straightforward library for building domain-driven microservice architectures
1 lines • 661 B
Source Map (JSON)
{"version":3,"sources":["../src/utils/State.ts"],"sourcesContent":["import { Construct, ofConstruct } from '../types/Constructor';\n\nexport class State {\n constructor(protected readonly state: any = {}) {}\n\n protected get = <T>(key: string, alt?: Construct<T>): T => this.state[key] ?? (this.state[key] = ofConstruct(alt));\n protected set = <T>(key: string, value: Construct<T>): T => this.get(key, value);\n}\n"],"mappings":";;;;;AAEO,IAAM,QAAN,MAAY;AAAA,EACjB,YAA+B,QAAa,CAAC,GAAG;AAAjB;AAAA,EAAkB;AAAA,EAEvC,MAAM,CAAI,KAAa,QAA0B,KAAK,MAAM,GAAG,MAAM,KAAK,MAAM,GAAG,IAAI,YAAY,GAAG;AAAA,EACtG,MAAM,CAAI,KAAa,UAA2B,KAAK,IAAI,KAAK,KAAK;AACjF;","names":[]}