@ -1,4 +1,4 @@
import { AssFile , AssUser , NID , UploadToken } from "ass" ;
import { AssFile , AssUser , NID , UploadToken } from 'ass' ;
export type DatabaseValue = AssFile | AssUser | UploadToken ;
export type DatabaseTable = 'assfiles' | 'assusers' | 'asstokens' ;
@ -73,7 +73,7 @@ export class DBManager {
public static configure ( ) : Promise < void > {
if ( this . _db && this . _dbReady ) {
return this . _db . configure ( ) ;
} else throw new Error ( "No database active" ) ;
} else throw new Error ( 'No database active' ) ;
}
/ * *
@ -82,7 +82,7 @@ export class DBManager {
public static put ( table : DatabaseTable , key : NID , data : DatabaseValue ) : Promise < void > {
if ( this . _db && this . _dbReady ) {
return this . _db . put ( table , key , data ) ;
} else throw new Error ( "No database active" ) ;
} else throw new Error ( 'No database active' ) ;
}
/ * *
@ -91,7 +91,7 @@ export class DBManager {
public static get ( table : DatabaseTable , key : NID ) : Promise < DatabaseValue | undefined > {
if ( this . _db && this . _dbReady ) {
return this . _db . get ( table , key ) ;
} else throw new Error ( "No database active" ) ;
} else throw new Error ( 'No database active' ) ;
}
/ * *
@ -100,6 +100,6 @@ export class DBManager {
public static getAll ( table : DatabaseTable ) : Promise < { [ index : string ] : DatabaseValue } > {
if ( this . _db && this . _dbReady ) {
return this . _db . getAll ( table ) ;
} else throw new Error ( "No database active" ) ;
} else throw new Error ( 'No database active' ) ;
}
}