Linted all config files.
This commit is contained in:
@@ -25,11 +25,11 @@ class Config {
|
|||||||
throw new Error(`Filed "${section} => ${option}" does not exist.`);
|
throw new Error(`Filed "${section} => ${option}" does not exist.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const field = new Field(this.fields[section][option])
|
const field = new Field(this.fields[section][option]);
|
||||||
|
|
||||||
if (field.value === '') {
|
if (field.value === '') {
|
||||||
const envField = process.env[[section.toUpperCase(), option.toUpperCase()].join('_')]
|
const envField = process.env[[section.toUpperCase(), option.toUpperCase()].join('_')];
|
||||||
if (envField !== undefined && envField.length !== 0) { return envField }
|
if (envField !== undefined && envField.length !== 0) { return envField; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field.value === undefined) {
|
if (field.value === undefined) {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class EnvironmentVariables {
|
class EnvironmentVariables {
|
||||||
|
|
||||||
constructor(variables) {
|
constructor(variables) {
|
||||||
this.variables = variables || process.env;
|
this.variables = variables || process.env;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ const Filters = require('./filters.js');
|
|||||||
const EnvironmentVariables = require('./environmentVariables.js');
|
const EnvironmentVariables = require('./environmentVariables.js');
|
||||||
|
|
||||||
class Field {
|
class Field {
|
||||||
|
|
||||||
constructor(rawValue, environmentVariables) {
|
constructor(rawValue, environmentVariables) {
|
||||||
this.rawValue = rawValue;
|
this.rawValue = rawValue;
|
||||||
this.filters = new Filters(rawValue);
|
this.filters = new Filters(rawValue);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class Filters {
|
class Filters {
|
||||||
|
|
||||||
constructor(value) {
|
constructor(value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.delimiter = '|';
|
this.delimiter = '|';
|
||||||
|
|||||||
Reference in New Issue
Block a user