This commit is contained in:
Nathan Bierema 2023-01-05 21:18:13 -05:00
parent 61cf775d19
commit a3138b1ce7
3 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import knex from 'knex';
import type { Knex } from 'knex'; import type { Knex } from 'knex';
import { AGServer } from 'socketcluster-server'; import { AGServer } from 'socketcluster-server';
// eslint-disable-next-line @typescript-eslint/ban-types
type KnexFunction = <TRecord extends {} = any, TResult = unknown[]>( type KnexFunction = <TRecord extends {} = any, TResult = unknown[]>(
config: Knex.Config | string config: Knex.Config | string
) => Knex<TRecord, TResult>; ) => Knex<TRecord, TResult>;

View File

@ -31,7 +31,7 @@ export interface Options {
export default function getOptions(argv: { [arg: string]: any }): Options { export default function getOptions(argv: { [arg: string]: any }): Options {
let dbOptions = argv.dbOptions; let dbOptions = argv.dbOptions;
if (typeof dbOptions === 'string') { if (typeof dbOptions === 'string') {
dbOptions = JSON.parse(fs.readFileSync(argv.dbOptions, 'utf8')); dbOptions = JSON.parse(fs.readFileSync(dbOptions, 'utf8'));
} else if (typeof dbOptions === 'undefined') { } else if (typeof dbOptions === 'undefined') {
dbOptions = JSON.parse( dbOptions = JSON.parse(
fs.readFileSync( fs.readFileSync(