From: Jérôme Benoit Date: Tue, 18 Nov 2025 16:17:18 +0000 (+0100) Subject: refactor: spell fixes X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=816572d37493339f2e25fb3941954cd142dabb29;p=e-mobility-charging-stations-simulator.git refactor: spell fixes Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/auth/index.ts b/src/charging-station/ocpp/auth/index.ts index 2be89d17..bd323c8a 100644 --- a/src/charging-station/ocpp/auth/index.ts +++ b/src/charging-station/ocpp/auth/index.ts @@ -72,8 +72,8 @@ export { } from './types/AuthTypes.js' export { isCertificateBased, - isOCCP16Type, - isOCCP20Type, + isOCPP16Type, + isOCPP20Type, mapOCPP16Status, mapOCPP20TokenType, mapToOCPP16Status, diff --git a/src/charging-station/ocpp/auth/types/AuthTypes.ts b/src/charging-station/ocpp/auth/types/AuthTypes.ts index 3fccdd3f..641b2fb7 100644 --- a/src/charging-station/ocpp/auth/types/AuthTypes.ts +++ b/src/charging-station/ocpp/auth/types/AuthTypes.ts @@ -300,20 +300,20 @@ export const isCertificateBased = (type: IdentifierType): boolean => { } /** - * Check if identifier type is OCCP 1.6 compatible + * Check if identifier type is OCPP 1.6 compatible * @param type - Identifier type to check * @returns True if OCPP 1.6 type */ -export const isOCCP16Type = (type: IdentifierType): boolean => { +export const isOCPP16Type = (type: IdentifierType): boolean => { return type === IdentifierType.ID_TAG } /** - * Check if identifier type is OCCP 2.0 compatible + * Check if identifier type is OCPP 2.0 compatible * @param type - Identifier type to check * @returns True if OCPP 2.0 type */ -export const isOCCP20Type = (type: IdentifierType): boolean => { +export const isOCPP20Type = (type: IdentifierType): boolean => { return Object.values(OCPP20IdTokenEnumType).includes(type as unknown as OCPP20IdTokenEnumType) } diff --git a/tests/charging-station/ocpp/auth/types/AuthTypes.test.ts b/tests/charging-station/ocpp/auth/types/AuthTypes.test.ts index 32b170c5..7a25990a 100644 --- a/tests/charging-station/ocpp/auth/types/AuthTypes.test.ts +++ b/tests/charging-station/ocpp/auth/types/AuthTypes.test.ts @@ -9,8 +9,8 @@ import { AuthorizationStatus, IdentifierType, isCertificateBased, - isOCCP16Type, - isOCCP20Type, + isOCPP16Type, + isOCPP20Type, mapOCPP16Status, mapOCPP20TokenType, mapToOCPP16Status, @@ -29,16 +29,16 @@ import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js' await describe('AuthTypes', async () => { await describe('IdentifierTypeGuards', async () => { await it('should correctly identify OCPP 1.6 types', () => { - expect(isOCCP16Type(IdentifierType.ID_TAG)).toBe(true) - expect(isOCCP16Type(IdentifierType.CENTRAL)).toBe(false) - expect(isOCCP16Type(IdentifierType.LOCAL)).toBe(false) + expect(isOCPP16Type(IdentifierType.ID_TAG)).toBe(true) + expect(isOCPP16Type(IdentifierType.CENTRAL)).toBe(false) + expect(isOCPP16Type(IdentifierType.LOCAL)).toBe(false) }) await it('should correctly identify OCPP 2.0 types', () => { - expect(isOCCP20Type(IdentifierType.CENTRAL)).toBe(true) - expect(isOCCP20Type(IdentifierType.LOCAL)).toBe(true) - expect(isOCCP20Type(IdentifierType.E_MAID)).toBe(true) - expect(isOCCP20Type(IdentifierType.ID_TAG)).toBe(false) + expect(isOCPP20Type(IdentifierType.CENTRAL)).toBe(true) + expect(isOCPP20Type(IdentifierType.LOCAL)).toBe(true) + expect(isOCPP20Type(IdentifierType.E_MAID)).toBe(true) + expect(isOCPP20Type(IdentifierType.ID_TAG)).toBe(false) }) await it('should correctly identify certificate-based types', () => {