-import fs from 'fs';
-import path from 'path';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
import chalk from 'chalk';
import merge from 'just-merge';
uiServerConfiguration = merge(uiServerConfiguration, Configuration.getConfig()?.uiServer);
}
if (Configuration.isCFEnvironment() === true) {
- delete uiServerConfiguration.options.host;
+ delete uiServerConfiguration.options?.host;
uiServerConfiguration.options.port = parseInt(process.env.PORT);
}
return uiServerConfiguration;
) {
console.error(
chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage in section '${sectionName}'${
- logMsgToAppend && `. ${logMsgToAppend}`
+ logMsgToAppend.trim().length !== 0 && `. ${logMsgToAppend}`
}}`
);
} else if (!Configuration.isUndefined(Configuration.getConfig()[key])) {
console.error(
chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage${
- logMsgToAppend && `. ${logMsgToAppend}`
+ logMsgToAppend.trim().length !== 0 && `. ${logMsgToAppend}`
}}`
);
}
private static getConfigurationFileWatcher(): fs.FSWatcher | undefined {
try {
return fs.watch(Configuration.configurationFile, (event, filename): void => {
- if (filename && event === 'change') {
+ if (filename.trim().length !== 0 && event === 'change') {
// Nullify to force configuration file reading
Configuration.configuration = null;
if (!Configuration.isUndefined(Configuration.configurationChangeCallback)) {
- Configuration.configurationChangeCallback().catch(error => {
+ Configuration.configurationChangeCallback().catch((error) => {
throw typeof error === 'string' ? new Error(error) : error;
});
}