fix(config): json parsing (e.g. ssl) (#203)

This commit is contained in:
George authored and GitHub committed 2023-11-08 02:04:57 +11:00
1 parent 0398abc501
commit e7ae5a6f30
1 file changed
+6 -2
+6 -2
View File
@@ -80,13 +80,17 @@ export const connectionOptions = (() => {
convertNamedPlaceholders = options.namedPlaceholders === 'false' ? null : require('named-placeholders')();
for (const key in ['dateStrings', 'flags', 'ssl']) {
for (const key of ['dateStrings', 'flags', 'ssl']) {
const value = options[key];
if (typeof value === 'string') {
try {
options[key] = JSON.parse(value);
} catch {}
} catch (err) {
console.log(
`^3Failed to parse property ${key} in configuration (${err})!^0`
)
}
}
}