type StatusNotificationRequest,
type StatusNotificationResponse,
} from '../../types';
-import { ErrorUtils, Utils, logger } from '../../utils';
+import { Utils, handleFileException, logger } from '../../utils';
export class OCPPServiceUtils {
protected constructor() {
try {
return JSON.parse(fs.readFileSync(filePath, 'utf8')) as JSONSchemaType<T>;
} catch (error) {
- ErrorUtils.handleFileException(
+ handleFileException(
filePath,
FileType.JsonSchema,
error as NodeJS.ErrnoException,
unitMultiplier: 1,
}
): number {
- options.limitationEnabled = options?.limitationEnabled ?? true;
- options.unitMultiplier = options?.unitMultiplier ?? 1;
+ options = {
+ ...{
+ limitationEnabled: true,
+ unitMultiplier: 1,
+ },
+ ...options,
+ };
const parsedInt = parseInt(value);
const numberValue = isNaN(parsedInt) ? Infinity : parsedInt;
return options?.limitationEnabled