new Registry()
Methods
add(nameopt, itemopt)
Register an item and return it.
Adds an item to the registry using the provided name (or the class name), converted to all lower case.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
Case-insensitive item key. If not given, fallsback to |
item |
<optional> |
If unregistered or omitted, nothing is added and method returns
|
Returns:
Newly registered item or undefined
if unregistered.
addSynonym(synonymName, existingName) → {function|Constructor}
Register a synonym for an existing item.
Parameters:
Name | Type | Description |
---|---|---|
synonymName |
string | |
existingName |
string |
Returns:
The previously registered item this new synonym points to.
- Type
- function | Constructor
get(nameopt) → {*|undefined}
Fetch a registered item.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
Returns:
A registered item or undefined
if unregistered.
- Type
- * | undefined