Module: bajaux/registry/RegistryEntry

An entry intended to be stored in a local Registry, representing a single
RequireJS module. Additional parameters can be used to store metadata
about this module, allowing it to be queried later in more detail.

There is usually no reason to instantiate this class directly;
a Registry will create them as needed.

API Status: Development


new (require("bajaux/registry/RegistryEntry"))(params)

Parameters:
Name Type Description
params module:bajaux/registry/Registry~QueryParams
Since:
  • Niagara 4.10

Methods


getJsDependencies()

Get the list of RequireJS dependencies (typically builtfiles) that must
be loaded before requiring the main RequireJS ID.

Returns:
Type
Array.<String>

getJsId()

Get the RequireJS ID for this entry.

Returns:
Type
string

getTags()

Get a list of tags that serve as metadata for this entry.

Returns:
Type
Array.<String>

matches( [params])

Check to see if this entry's metadata matches a registry query.

Parameters:
Name Type Argument Description
params module:bajaux/registry/Registry~QueryParams | module:bajaux/registry/RegistryEntry <optional>
Returns:

true if this entry matches the query parameters and
so should be included in the results

Type
boolean

resolve()

Resolve the RequireJS module (and any dependencies) that is represented
by this module.

Returns:

promise to be resolved with the contents of
the RequireJS module, or rejected if the module ID or any of its
dependencies could not be loaded

Type
Promise

toJSON()

Return a raw object representation of this entry. As a contractual
requirement, the output of this function should be able to be passed right
back to the constructor to create a new instance. Return undefined to
indicate that this entry should never be serialized.

Returns:
Type
Object | undefined