nomad

@lacrypta/nomad v0.0.0 / Dependency

Interface: Dependency

Interface representing an atomic dependency.

A “dependency” is an entity comprised of three parts:

Accessors

code

get code(): string

Get the Dependency source code.

set code(code: string): void

Set the Dependency source code.

See

Dependency.setCode for exceptions thrown.

Parameters

code: string

The function source code to set.

Returns

string

Defined in

dependency.ts:97


dependencies

get dependencies(): Map<string, string>

Get the Dependency dependencies.

set dependencies(dependencies: Map<string, string>): void

Set the Dependency dependencies.

See

Dependency.setDependencies for exceptions thrown.

Parameters

dependencies: Map<string, string>

The dependencies to set.

Returns

Map<string, string>

Defined in

dependency.ts:103


name

get name(): string

Get the Dependency name.

set name(name: string): void

Set the Dependency name.

See

Dependency.setName for exceptions thrown.

Parameters

name: string

The name to set.

Returns

string

Defined in

dependency.ts:109

Methods

addDependency()

addDependency(importedName: string, dependencyName: string): this

Add the given imported name / dependent dependency pair to this Dependency’s dependencies.

Parameters

importedName: string

Dependency Dependency.name to use for importing.

dependencyName: string

Dependency being depended on.

Returns

this

this, for chaining.

Throws

if an imported name fails regular expression validation.

Throws

if an imported name is forbidden.

Throws

if a dependency name fails regular expression validation.

Throws

if a dependency name is forbidden.

Defined in

dependency.ts:84


asObject()

asObject(): DependencyObject

Return the plain object representation of the Dependency.

Returns

DependencyObject

The Dependency, as an independent DependencyObject.

Defined in

dependency.ts:91


removeDependency()

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.

Parameters

dependencyName: string

Dependency Dependency.name to remove from the dependencies.

Returns

this

this, for chaining.

Defined in

dependency.ts:119


removeImport()

removeImport(importName: string): this

Remove the given import name from this Dependency’s dependencies.

Parameters

importName: string

Import name to remove from the dependencies.

Returns

this

this, for chaining.

Defined in

dependency.ts:127


setCode()

setCode(code: string): this

Set the Dependency source code.

Parameters

code: string

The function source code to set.

Returns

this

this, for chaining.

Throws

if the given function source code contains disallowed characters.

Throws

if the given function source code is not a valid strict mode function body.

Defined in

dependency.ts:161


setDependencies()

setDependencies(dependencies: Map<string, string>): this

Set the Dependency dependencies.

Parameters

dependencies: Map<string, string>

The dependencies to set.

Returns

this

this, for chaining.

See

addDependency for exceptions thrown.

Defined in

dependency.ts:170


setName()

setName(name: string): this

Set the Dependency name.

Parameters

name: string

The name to set.

Returns

this

this, for chaining.

Throws

if the given identifier fails regular expression validation.

Throws

if the given identifier is forbidden.

Defined in

dependency.ts:180