WIP: Format code with Google Typescript formatting guidelines

This commit is contained in:
2025-07-04 10:39:32 -04:00
parent e53d38e0ad
commit c834acdfec
12 changed files with 596 additions and 235 deletions

View File

@@ -1,9 +1,9 @@
import { Model, Sequelize, STRING } from "sequelize";
import {Model, Sequelize, STRING} from 'sequelize';
import "node:fs/promises";
import { readFile } from "node:fs";
import 'node:fs/promises';
import {readFile} from 'node:fs';
export const sql = new Sequelize("sqlite://./blitzcrank.sqlite");
export const sql = new Sequelize('sqlite://./blitzcrank.sqlite');
export class GuildSetting extends Model {
declare guildId: string;
@@ -13,19 +13,19 @@ export class GuildSetting extends Model {
GuildSetting.init(
{
guildId: { type: STRING },
key: { type: STRING },
value: { type: STRING },
guildId: {type: STRING},
key: {type: STRING},
value: {type: STRING},
},
{ sequelize: sql },
{sequelize: sql},
);
export async function initDb() {
try {
await sql.authenticate();
console.log("Connected to database");
console.log('Connected to database');
} catch (error) {
console.error("Unable to connect to the database:", error);
console.error('Unable to connect to the database:', error);
}
}
@@ -43,10 +43,10 @@ export async function readSettingsFromFile(path: string) {
});
}
}
GuildSetting.bulkCreate(toInsert, { updateOnDuplicate: ["value"] });
GuildSetting.bulkCreate(toInsert, {updateOnDuplicate: ['value']});
} catch (error) {
// TODO
console.log("Could not read settings:", error);
console.log('Could not read settings:', error);
}
});
}