Fix comments regarding typing

This commit is contained in:
Chongyi Zheng 2023-09-16 01:30:30 -04:00
parent cc9f37e971
commit 6065940269
No known key found for this signature in database
GPG key ID: E3C2287691E40E35
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ const { log } = require("../src/util");
* DO NOT ADD ANYTHING HERE! * DO NOT ADD ANYTHING HERE!
* IF YOU NEED TO ADD FIELDS, ADD IT TO ./db/knex_migrations * IF YOU NEED TO ADD FIELDS, ADD IT TO ./db/knex_migrations
* See ./db/knex_migrations/README.md for more information * See ./db/knex_migrations/README.md for more information
* @param {string} dbType "mariadb" or "postgres" * @param {"mariadb"|"postgres"} dbType database type, should be either "mariadb" or "postgres"
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async function createTables(dbType) { async function createTables(dbType) {

View file

@ -138,7 +138,7 @@ class Database {
* Read the database config * Read the database config
* @throws {Error} If the config is invalid * @throws {Error} If the config is invalid
* @typedef {string|undefined} envString * @typedef {string|undefined} envString
* @returns {{type: "sqlite" | "mariadb" | "embedded-mariadb" | "postgres"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} Database config * @returns {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} Database config
*/ */
static readDBConfig() { static readDBConfig() {
let dbConfig; let dbConfig;
@ -158,7 +158,7 @@ class Database {
/** /**
* @typedef {string|undefined} envString * @typedef {string|undefined} envString
* @param {{type: "sqlite" | "mariadb" | "embedded-mariadb" | "postgres"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} dbConfig the database configuration that should be written * @param {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} dbConfig the database configuration that should be written
* @returns {void} * @returns {void}
*/ */
static writeDBConfig(dbConfig) { static writeDBConfig(dbConfig) {