UNPKG

single-source-of-truth

Version:
35 lines 761 B
export class Store { #store = new Map(); get(name) { return this.#store.get(name)?.toStandard(); } getAll() { return [...this.#store.values()].map((v) => v.toStandard()); } has(name) { return this.#store.has(name); } set(name, schema) { return this.#store.set(name, schema); } get size() { return this.#store.size; } keys() { return this.#store.keys(); } values() { return this.#store.values(); } entries() { return this.#store.entries(); } get [Symbol.iterator]() { return this.#store.values(); } } export class Registry { enums = new Store(); models = new Store(); } //# sourceMappingURL=registry.js.map