Classes
Methods
(static) applyConfig(obj, cfg, requiredPropertiesopt, optionalPropertiesopt) → {object}
The function to update an instance based on required and optional properties description
The values of each properties defined in requiredProperties and optionalProperties will be converted to is type:
boolean, number, extent; and will be stored in an _{name} attribute
This will help to get values respecting the type defined in getter and to validate the config
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
object | the instance on which apply the config | |
cfg |
object | the lizmap config object | |
requiredProperties |
object |
<optional> |
the required properties definition |
optionalProperties |
object |
<optional> |
the optional properties definition |
- Source:
Throws:
-
-
for required properties
- Type
- ValidationError
-
-
-
for values
- Type
- ConversionError
-
Returns:
- The instance updated
- Type
- object