undefined return type

deepsource-autofix-76c6eb20
Dan Gowans 2022-12-07 13:02:36 -05:00
parent 812ea8618e
commit c5037f779f
2 changed files with 3 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import type * as recordTypes from "../../types/recordTypes";
export declare const getLotByLotName: (lotName: string) => recordTypes.Lot;
export declare const getLotByLotName: (lotName: string) => recordTypes.Lot | undefined;
export declare const getLot: (lotId: number | string) => recordTypes.Lot;
export default getLot;

View File

@ -21,10 +21,7 @@ const baseSQL =
" left join Maps m on l.mapId = m.mapId" +
" where l.recordDelete_timeMillis is null";
const _getLot = (
sql: string,
lotId_or_lotName: number | string
): recordTypes.Lot => {
const _getLot = (sql: string, lotId_or_lotName: number | string): recordTypes.Lot | undefined => {
const database = sqlite(databasePath, {
readonly: true
});
@ -52,7 +49,7 @@ const _getLot = (
return lot;
};
export const getLotByLotName = (lotName: string): recordTypes.Lot => {
export const getLotByLotName = (lotName: string): recordTypes.Lot | undefined => {
return _getLot(baseSQL + " and l.lotName = ?", lotName);
};