Replace convertToInt (parseInt — silently truncates 3.7 to 3) with
Number.isInteger check. The spec §9.1 defines these keys as Type:
integer, and §5.3 requires Rejected for values that do not conform
to the expected format.
OCPP16StandardParametersKey.WebSocketPingInterval,
])
if (integerKeys.has(keyToChange.key as OCPP16StandardParametersKey)) {
- const numValue = convertToInt(value)
- if (isNaN(numValue) || numValue < 0) {
+ const numValue = Number(value)
+ if (!Number.isInteger(numValue) || numValue < 0) {
return OCPP16Constants.OCPP_CONFIGURATION_RESPONSE_REJECTED
}
}