}
/**
- * 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)
}
AuthorizationStatus,
IdentifierType,
isCertificateBased,
- isOCCP16Type,
- isOCCP20Type,
+ isOCPP16Type,
+ isOCPP20Type,
mapOCPP16Status,
mapOCPP20TokenType,
mapToOCPP16Status,
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', () => {