repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: syntax check in worker configuration section
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
Utils.ts
diff --git
a/src/utils/Utils.ts
b/src/utils/Utils.ts
index 3ef99c5f2fdcab960c8e8234371eba0830d59c51..49a5fdf954c4a54e9eb807ab434880ec79027480 100644
(file)
--- a/
src/utils/Utils.ts
+++ b/
src/utils/Utils.ts
@@
-59,7
+59,7
@@
export const convertToDate = (
return value;
}
if (isString(value) || typeof value === 'number') {
return value;
}
if (isString(value) || typeof value === 'number') {
- return new Date(value);
+ return new Date(value
!
);
}
return null;
};
}
return null;
};
@@
-79,6
+79,7
@@
export const convertToInt = (value: unknown): number => {
changedValue = parseInt(value as string);
}
if (isNaN(changedValue)) {
changedValue = parseInt(value as string);
}
if (isNaN(changedValue)) {
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
throw new Error(`Cannot convert to integer: ${value.toString()}`);
}
return changedValue;
throw new Error(`Cannot convert to integer: ${value.toString()}`);
}
return changedValue;
@@
-93,6
+94,7
@@
export const convertToFloat = (value: unknown): number => {
changedValue = parseFloat(value as string);
}
if (isNaN(changedValue)) {
changedValue = parseFloat(value as string);
}
if (isNaN(changedValue)) {
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
throw new Error(`Cannot convert to float: ${value.toString()}`);
}
return changedValue;
throw new Error(`Cannot convert to float: ${value.toString()}`);
}
return changedValue;
@@
-297,7
+299,7
@@
export const JSONStringifyWithMapSupport = (
): string => {
return JSON.stringify(
obj,
): string => {
return JSON.stringify(
obj,
- (
key
, value: Record<string, unknown>) => {
+ (
_
, value: Record<string, unknown>) => {
if (value instanceof Map) {
return {
dataType: 'Map',
if (value instanceof Map) {
return {
dataType: 'Map',