Skip to content

Commit

Permalink
fix: ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
r41ph committed Nov 6, 2024
1 parent 280f361 commit 6811e48
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { DATE_FORMAT_SECONDARY, formatDate } from 'src/utils/format';
import {
DATE_FORMAT_SECONDARY,
formatDate,
} from 'web-components/src/utils/format';

export function formatCertificateDates(
startDate: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export const useFetchRetirement = ({ id }: Params) => {
// Extract data from batch denom id
const retirementData = retirement?.batchDenoms
.map(batch => (batch ? getDataFromBatchDenomId(batch) : undefined))
.filter(data => !!data);
.filter(
(data): data is ReturnType<typeof getDataFromBatchDenomId> => !!data,
);

// Get project and credit class metadata
const { projects, projectsMetadata, classes, classesMetadata } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export const useFetchRetirements = ({ address, hideRetirements }: Props) => {
.map(batchDenom =>
batchDenom ? getDataFromBatchDenomId(batchDenom) : undefined,
)
.filter(data => !!data),
.filter(
(data): data is ReturnType<typeof getDataFromBatchDenomId> => !!data,
),
);

// Get project and credit class metadata for each retirement
Expand Down

0 comments on commit 6811e48

Please sign in to comment.