Class: ConfigInterpreter<SchemeT, OutputT>
An abstract class that interprets a configuration file and returns a configuration object.
Since
0.11.0
Type parameters
| Name | Type |
|---|---|
SchemeT |
extends ConfigInterpreterScheme |
OutputT |
OutputT |
Hierarchy
ConfigInterpreter
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• Protected new ConfigInterpreter<SchemeT, OutputT>(scheme)
Type parameters
| Name | Type |
|---|---|
SchemeT |
extends ConfigInterpreterScheme |
OutputT |
OutputT |
Parameters
| Name | Type |
|---|---|
scheme |
SchemeT |
Defined in
kipper/config/src/abstract/config-interpreter.ts:82
Properties
scheme
• scheme: SchemeT
Defined in
kipper/config/src/abstract/config-interpreter.ts:80
Methods
checkType
▸ Private checkType(schemeValue, configValue, key, meta): void
Parameters
| Name | Type |
|---|---|
schemeValue |
ConfigInterpreterSchemeDefinition |
configValue |
any |
key |
string |
meta |
ConfigErrorMetaData |
Returns
void
Defined in
kipper/config/src/abstract/config-interpreter.ts:142
loadConfig
▸ Abstract loadConfig(config): Promise<OutputT>
Parameters
| Name | Type |
|---|---|
config |
ConfigFile |
Returns
Promise<OutputT>
Defined in
kipper/config/src/abstract/config-interpreter.ts:194
validateConfigBasedOffScheme
▸ Protected validateConfigBasedOffScheme(rawConfig, meta, parentConfig?): void
Validate a configuration file based off a scheme.
This is intended for basic validation, and should not be used for complex validation. There a custom validation methods should be implemented depending on the complexity of the configuration file.
Throws
ConfigValidationError If the configuration file is invalid.
Since
0.11.0
Parameters
| Name | Type | Description |
|---|---|---|
rawConfig |
Object |
The configuration file to validate. |
meta |
ConfigErrorMetaData |
The metadata for any error that may be thrown. |
parentConfig? |
RawEvaluatedKipperConfigFile |
The parent configuration file of the configuration file. If provided any required errors will be ignored if the parent configuration file has the required field. |
Returns
void
Defined in
kipper/config/src/abstract/config-interpreter.ts:99
validateConfigBasedOffSchemeRecursive
▸ Private validateConfigBasedOffSchemeRecursive(configFile, scheme, meta, parentConfig?): void
Raw recursive function to validate a configuration file based off a scheme.
Throws
ConfigValidationError If the configuration file is invalid.
Since
0.11.0
Parameters
| Name | Type | Description |
|---|---|---|
configFile |
Object |
The configuration file to validate. |
scheme |
ConfigInterpreterScheme |
The scheme to validate the configuration file against. |
meta |
ConfigErrorMetaData |
The metadata for any error that may be thrown. |
parentConfig? |
RawEvaluatedKipperConfigFile |
The parent configuration file of the configuration file. If provided any required errors will be ignored if the parent configuration file has the required field. |
Returns
void
Defined in
kipper/config/src/abstract/config-interpreter.ts:118