Linted all config files.

This commit is contained in:
2018-02-07 13:49:11 +01:00
parent 444295d5d1
commit fe1ad2b1ad
4 changed files with 97 additions and 100 deletions

View File

@@ -25,11 +25,11 @@ class Config {
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 === '') {
const envField = process.env[[section.toUpperCase(), option.toUpperCase()].join('_')]
if (envField !== undefined && envField.length !== 0) { return envField }
const envField = process.env[[section.toUpperCase(), option.toUpperCase()].join('_')];
if (envField !== undefined && envField.length !== 0) { return envField; }
}
if (field.value === undefined) {

View File

@@ -1,5 +1,4 @@
class EnvironmentVariables {
constructor(variables) {
this.variables = variables || process.env;
}

View File

@@ -2,7 +2,6 @@ const Filters = require('./filters.js');
const EnvironmentVariables = require('./environmentVariables.js');
class Field {
constructor(rawValue, environmentVariables) {
this.rawValue = rawValue;
this.filters = new Filters(rawValue);

View File

@@ -1,5 +1,4 @@
class Filters {
constructor(value) {
this.value = value;
this.delimiter = '|';