mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
⚡ Make n8n work with new version of convict
This commit is contained in:
parent
bed5195eb8
commit
5f96f01f24
|
@ -95,14 +95,14 @@ export async function getConfigValue(configKey: string): Promise<string | boolea
|
|||
|
||||
// Get the environment variable
|
||||
const configSchema = config.getSchema();
|
||||
let currentSchema = configSchema.properties as IDataObject;
|
||||
let currentSchema = configSchema._cvtProperties as IDataObject;
|
||||
for (const key of configKeyParts) {
|
||||
if (currentSchema[key] === undefined) {
|
||||
throw new Error(`Key "${key}" of ConfigKey "${configKey}" does not exist`);
|
||||
} else if ((currentSchema[key]! as IDataObject).properties === undefined) {
|
||||
} else if ((currentSchema[key]! as IDataObject)._cvtProperties === undefined) {
|
||||
currentSchema = currentSchema[key] as IDataObject;
|
||||
} else {
|
||||
currentSchema = (currentSchema[key] as IDataObject).properties as IDataObject;
|
||||
currentSchema = (currentSchema[key] as IDataObject)._cvtProperties as IDataObject;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue