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
fix: ensure convertToDate() convert null date to undefined
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
Utils.ts
diff --git
a/src/utils/Utils.ts
b/src/utils/Utils.ts
index 6f4517bee1b5aaf213698fbb976c421660ef1f6d..9d2b92fa4239856b0c064d062168dc5cb121a93d 100644
(file)
--- a/
src/utils/Utils.ts
+++ b/
src/utils/Utils.ts
@@
-77,9
+77,9
@@
export const isValidDate = (date: Date | number | undefined): date is Date | num
export const convertToDate = (
value: Date | string | number | undefined | null
-): Date | undefined
| null
=> {
+): Date | undefined => {
if (value == null) {
- return
value
+ return
undefined
}
if (isDate(value)) {
return value