type ResponsePayload,
ResponseStatus
} from '../../../types/index.js'
-import { isNotEmptyArray, isNullOrUndefined, logger } from '../../../utils/index.js'
+import { isNotEmptyArray, logger } from '../../../utils/index.js'
import { Bootstrap } from '../../Bootstrap.js'
import { UIServiceWorkerBroadcastChannel } from '../../broadcast-channel/UIServiceWorkerBroadcastChannel.js'
import type { AbstractUIServer } from '../AbstractUIServer.js'
errorDetails: (error as OCPPError).details
}
}
- if (!isNullOrUndefined(responsePayload)) {
+ if (responsePayload != null) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- return this.uiServer.buildProtocolResponse(messageId!, responsePayload!)
+ return this.uiServer.buildProtocolResponse(messageId!, responsePayload)
}
}
if (isNotEmptyArray(payload.hashIds)) {
payload.hashIds = payload.hashIds
?.map((hashId) => {
- if (hashId !== undefined && this.uiServer.chargingStations.has(hashId)) {
+ if (hashId != null && this.uiServer.chargingStations.has(hashId)) {
return hashId
}
logger.warn(
)
return undefined
})
- ?.filter((hashId) => !isNullOrUndefined(hashId)) as string[]
+ ?.filter((hashId) => hashId != null) as string[]
} else {
delete payload.hashIds
}