-import Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
-import ajvFormats from 'ajv-formats';
+import _Ajv, { type JSONSchemaType, type ValidateFunction } from 'ajv';
+import _ajvFormats from 'ajv-formats';
import { OCPPConstants } from './OCPPConstants.js';
import { OCPPServiceUtils } from './OCPPServiceUtils.js';
OCPPVersion,
} from '../../types/index.js';
import { logger, setDefaultErrorParams } from '../../utils/index.js';
+type Ajv = _Ajv.default;
+const Ajv = _Ajv.default;
+const ajvFormats = _ajvFormats.default;
const moduleName = 'OCPPIncomingRequestService';
protected constructor(version: OCPPVersion) {
this.version = version;
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.ajv = new Ajv({
keywords: ['javaType'],
multipleOfPrecision: 2,
schema: JSONSchemaType<T>,
) {
if (this.jsonValidateFunctions.has(commandName) === false) {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
this.jsonValidateFunctions.set(commandName, this.ajv.compile<T>(schema).bind(this));
}
return this.jsonValidateFunctions.get(commandName)!;