linting
parent
c88e4912f8
commit
5b4a316aac
|
|
@ -25,7 +25,7 @@ function onError(error) {
|
|||
}
|
||||
function onListening(server) {
|
||||
const addr = server.address();
|
||||
if (addr) {
|
||||
if (addr !== null) {
|
||||
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port.toString();
|
||||
debug('Listening on ' + bind);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ function onError(error: ServerError): void {
|
|||
function onListening(server: http.Server): void {
|
||||
const addr = server.address()
|
||||
|
||||
if (addr) {
|
||||
if (addr !== null) {
|
||||
const bind =
|
||||
typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port.toString()
|
||||
debug('Listening on ' + bind)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export async function handler(_request, response) {
|
|||
const occupancyTypePrintTitles = {};
|
||||
for (const printEJS of occupancyTypePrints) {
|
||||
const printConfig = printFunctions.getPrintConfig(printEJS);
|
||||
if (printConfig) {
|
||||
if (printConfig !== undefined) {
|
||||
occupancyTypePrintTitles[printEJS] = printConfig.title;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export async function handler(
|
|||
for (const printEJS of occupancyTypePrints) {
|
||||
const printConfig = printFunctions.getPrintConfig(printEJS)
|
||||
|
||||
if (printConfig) {
|
||||
if (printConfig !== undefined) {
|
||||
occupancyTypePrintTitles[printEJS] = printConfig.title
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import * as configFunctions from '../../helpers/functions.config.js'
|
|||
import { getMaps } from '../../helpers/lotOccupancyDB/getMaps.js'
|
||||
import * as cacheFunctions from '../../helpers/functions.cache.js'
|
||||
|
||||
import * as recordTypes from '../../types/recordTypes'
|
||||
import type * as recordTypes from '../../types/recordTypes'
|
||||
|
||||
export async function handler(
|
||||
request: Request,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import { Request, Response } from 'express';
|
||||
import type { Request, Response } from 'express';
|
||||
export declare function handler(request: Request, response: Response): Promise<void>;
|
||||
export default handler;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { Request, Response } from 'express'
|
||||
import type { Request, Response } from 'express'
|
||||
|
||||
import { getLots } from '../../helpers/lotOccupancyDB/getLots.js'
|
||||
|
||||
export async function handler(request: Request, response: Response): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export async function getReportData(printConfig, requestQuery) {
|
|||
if (printConfig.params.includes('lotOccupancyId') &&
|
||||
typeof requestQuery.lotOccupancyId === 'string') {
|
||||
const lotOccupancy = await getLotOccupancy(requestQuery.lotOccupancyId);
|
||||
if (lotOccupancy?.lotId) {
|
||||
if ((lotOccupancy?.lotId ?? -1) !== -1) {
|
||||
reportData.lot = getLot(lotOccupancy.lotId);
|
||||
}
|
||||
reportData.lotOccupancy = lotOccupancy;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@ const screenPrintConfigs: Record<string, PrintConfig> = {
|
|||
}
|
||||
}
|
||||
|
||||
export function getScreenPrintConfig(printName: string): PrintConfig | undefined {
|
||||
export function getScreenPrintConfig(
|
||||
printName: string
|
||||
): PrintConfig | undefined {
|
||||
return screenPrintConfigs[printName]
|
||||
}
|
||||
|
||||
|
|
@ -78,8 +80,8 @@ export async function getReportData(
|
|||
) {
|
||||
const lotOccupancy = await getLotOccupancy(requestQuery.lotOccupancyId)
|
||||
|
||||
if (lotOccupancy?.lotId) {
|
||||
reportData.lot = getLot(lotOccupancy.lotId)
|
||||
if ((lotOccupancy?.lotId ?? -1) !== -1) {
|
||||
reportData.lot = getLot(lotOccupancy!.lotId!)
|
||||
}
|
||||
|
||||
reportData.lotOccupancy = lotOccupancy
|
||||
|
|
|
|||
Loading…
Reference in New Issue