solarnetwork-api-core
    Preparing search index...

    Class Configuration

    A configuration utility object.

    Properties can be get/set by using the Util.Configuration#value function. Properties added this way become enumerable properties of the Configuration instance as well.

    Hierarchy (View Summary)

    Implements

    • Record<string, any>
    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    Methods

    • Test if a key is truthy.

      Parameters

      • key: string

        the key to test

      Returns boolean

      true if the key is enabled

    • Set or toggle the enabled status of a given key.

      If the enabled parameter is not passed, then the enabled status will be toggled to its opposite value.

      Parameters

      • key: string

        the key to set

      • Optionalenabled: boolean

        the optional enabled value to set

      Returns this

      this object to allow method chaining

    • Get a configuration value.

      Parameters

      • key: string

        the key to get

      Returns any

      the associated value for the given key

    • Set a configuration value.

      Parameters

      • key: string

        the key to get or set the value for

      • newValue: any

        the new value to set for the given key. If null then the value will be removed.

      Returns this

      this object.

    • Get all properties.

      Returns Record<string, any>

      all properties of this object copied into a simple object

    • Set multiple properties.

      Parameters

      • newMap: Record<string, any> | PropMap | Map<string, any>

        a map of values to set

      Returns this

      this object