Add eslint
This commit is contained in:
@@ -30,7 +30,7 @@ export const useI18nKey = () => {
|
||||
| Record<`${K}_${Locale}`, string | null | undefined>
|
||||
| null
|
||||
| undefined
|
||||
| {},
|
||||
| object,
|
||||
key: K
|
||||
): obj is Record<`${K}_${Locale}`, string> {
|
||||
return (
|
||||
|
||||
@@ -64,11 +64,16 @@ function isRangeModel(
|
||||
return (
|
||||
!!model &&
|
||||
typeof model === 'object' &&
|
||||
(model as DateInputRange<any>)?.end !== undefined &&
|
||||
(model as DateInputRange<any>)?.start !== undefined
|
||||
(model as DateInputRange<DateInputDate>)?.end !== undefined &&
|
||||
(model as DateInputRange<DateInputDate>)?.start !== undefined
|
||||
);
|
||||
}
|
||||
|
||||
function isDateModel(model: DateInputModelValue): model is DateInputDate {
|
||||
return !!model && !isNaN(new Date(model as any).getTime());
|
||||
return (
|
||||
!!model &&
|
||||
!Array.isArray(model) &&
|
||||
!isRangeModel(model) &&
|
||||
!isNaN(new Date(model).getTime())
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user