fix linting
Some checks failed
Angular Build / build (push) Has been cancelled

This commit is contained in:
2026-03-20 21:02:02 +01:00
parent d484239429
commit 893a13a8f2
30 changed files with 1936 additions and 3359 deletions

View File

@@ -74,8 +74,8 @@ export class GuestComponent {
}
if (typeof value === 'object' && value !== null) {
if ('toDate' in value && typeof value.toDate === 'function') {
return value.toDate() as Date;
if (this.hasToDate(value)) {
return value.toDate();
}
if ('seconds' in value && typeof value.seconds === 'number') {
@@ -90,6 +90,10 @@ export class GuestComponent {
return null;
}
private hasToDate(value: object): value is FirestoreDateLike {
return 'toDate' in value && typeof value.toDate === 'function';
}
}
interface GuestShowView extends Omit<GuestShow, 'date' | 'updatedAt'> {
@@ -97,8 +101,8 @@ interface GuestShowView extends Omit<GuestShow, 'date' | 'updatedAt'> {
updatedAt: Date | null;
}
type GuestShowState =
| {status: 'loading'}
| {status: 'not-found'}
| {status: 'error'; message: string}
| {status: 'loaded'; show: GuestShowView};
type GuestShowState = {status: 'loading'} | {status: 'not-found'} | {status: 'error'; message: string} | {status: 'loaded'; show: GuestShowView};
type FirestoreDateLike = {
toDate: () => Date;
};