import { default } from "https://deno.land/x/justaos_orm@v10.0.0/src/Registry.ts";
Registry class is a generic class that provides a registry functionality for any type of object. It uses a Map to store the objects, where the key is a string and the value is of type T. The key for each object is determined by a function passed to the constructor.
Constructors
new
default(getKey: (item: T) => string)Creates a new Registry.
Properties
private
registry: Map<string, T>The Map object that stores the registry items.
Methods
Adds an item to the registry. The key for the item is determined by the getKey function passed to the constructor.
delete(name: string): boolean
Deletes an item with the given name from the registry.
has(name: string): boolean
Checks if an item with the given name exists in the registry.
hasEntries(): boolean