@lacrypta/nomad v0.0.0 / Dependency
Interface representing an atomic dependency.
A “dependency” is an entity comprised of three parts:
get code(): string
Get the Dependency source code.
set code(code: string): void
Set the Dependency source code.
Dependency.setCode for exceptions thrown.
• code: string
The function source code to set.
string
get dependencies(): Map<string, string>
Get the Dependency dependencies.
set dependencies(dependencies: Map<string, string>): void
Set the Dependency dependencies.
Dependency.setDependencies for exceptions thrown.
• dependencies: Map
<string
, string
>
The dependencies to set.
Map
<string
, string
>
get name(): string
Get the Dependency name.
set name(name: string): void
Set the Dependency name.
Dependency.setName for exceptions thrown.
• name: string
The name to set.
string
addDependency(importedName: string, dependencyName: string): this
Add the given imported name / dependent dependency pair to this Dependency’s dependencies.
• importedName: string
Dependency Dependency.name to use for importing.
• dependencyName: string
Dependency being depended on.
this
this
, for chaining.
if an imported name fails regular expression validation.
if an imported name is forbidden.
if a dependency name fails regular expression validation.
if a dependency name is forbidden.
asObject(): DependencyObject
Return the plain object representation of the Dependency.
The Dependency, as an independent DependencyObject.
removeDependency(dependencyName: string): this
Remove the given dependency Dependency.name from this Dependency’s dependencies.
Note that this may remove more than one dependency from this Dependency’s dependencies.
• dependencyName: string
Dependency Dependency.name to remove from the dependencies.
this
this
, for chaining.
removeImport(importName: string): this
Remove the given import name from this Dependency’s dependencies.
• importName: string
Import name to remove from the dependencies.
this
this
, for chaining.
setCode(code: string): this
Set the Dependency source code.
• code: string
The function source code to set.
this
this
, for chaining.
if the given function source code contains disallowed characters.
if the given function source code is not a valid strict mode function body.
setDependencies(dependencies: Map<string, string>): this
Set the Dependency dependencies.
• dependencies: Map
<string
, string
>
The dependencies to set.
this
this
, for chaining.
addDependency for exceptions thrown.
setName(name: string): this
Set the Dependency name.
• name: string
The name to set.
this
this
, for chaining.
if the given identifier fails regular expression validation.
if the given identifier is forbidden.