Merge branch 'master' into feature/slash-commands

This commit is contained in:
Max Isom 2022-02-05 13:11:32 -05:00
commit b9e21222f5
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
4 changed files with 22 additions and 4 deletions

View file

@ -40,7 +40,7 @@ export default class Config {
if (typeof value === 'number') {
this[key as ConditionalKeys<typeof CONFIG_MAP, number>] = value;
} else if (typeof value === 'string') {
this[key as ConditionalKeys<typeof CONFIG_MAP, string>] = value;
this[key as ConditionalKeys<typeof CONFIG_MAP, string>] = value.trim();
} else if (typeof value === 'boolean') {
this[key as ConditionalKeys<typeof CONFIG_MAP, boolean>] = value;
} else {

View file

@ -2,6 +2,14 @@ import {join} from 'path';
export const createDatabasePath = (directory: string) => join(directory, 'db.sqlite');
const createDatabaseUrl = (directory: string) => `file:${createDatabasePath(directory)}`;
const createDatabaseUrl = (directory: string) => {
const url = `file:${createDatabasePath(directory)}`;
if (process.platform === 'win32') {
return url.replaceAll(/\\/g, '\\\\');
}
return url;
};
export default createDatabaseUrl;