Constructor.
This will define the following default properties, if not supplied on the
config
argument:
These properties correspond to those on the window.location
object when
running in a browser. Thus to construct an environment based on the location
of the current page you can create an instance like this:
const env = new Environment(window.location);
Optional
config: Partial<HostConfigInfo>an optional set of properties to start with
Get direct access to the underlying property map.
Test if a key is truthy.
the key to test
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.
the key to set
Optional
enabled: booleanthe optional enabled value to set
this object to allow method chaining
Check if TLS is in use via the https
protocol.
true
if the protocol
is set to https
Get a configuration value.
the key to get
the associated value for the given key
Set a configuration value.
the key to get or set the value for
the new value to set for the given key
.
If null
then the value will be removed.
this object.
Get all properties.
all properties of this object copied into a simple object
Set multiple properties.
a map of values to set
this object
A network environment configuration utility object.
This extends Util.Configuration to add support for standard properties needed to access the SolarNetwork API, such as host and protocol values.