Represents an environment variable with methods to resolve its value based on the environment type.

Type Parameters

  • T

    The type of the environment variable value.

Constructors

Methods

Constructors

  • Constructs a new instance of the EnvironmentVar class.

    Type Parameters

    • T

    Parameters

    • paramName: string

      The name of the environment variable.

    • type: EnvironmentType

      The type of the environment.

    • Optionaloptional: boolean = true

      Indicates whether the environment variable is optional.

    • OptionalparamPrefix: string

      The prefix to be added to the environment variable name.

    Returns default<T>

Methods

  • Resolves the value based on the environment type.

    Returns Promise<undefined | T>

    • The resolved value.
  • Resolves the value of the environment variable synchronously.

    Returns T

    • The resolved value of the environment variable.
    • If the environment type is not 'Local'.