Skip to content

Commit 3af8db2

Browse files
chore: replace any by unknown
1 parent 02ae770 commit 3af8db2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

templates/next/components/common/Pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FunctionComponent } from "react";
33
import { PagedCollection } from "../../types/Collection";
44

55
interface Props {
6-
collection: PagedCollection<any>;
6+
collection: PagedCollection<unknown>;
77
}
88

99
const Pagination = ({ collection }: Props) => {

templates/next/utils/dataAccess.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export const fetch = async (id: string, init: RequestInit = {}) => {
5656
throw { defaultErrorMsg, status, fields };
5757
};
5858

59-
export const normalize = (data: any) => {
59+
export const normalize = (data: unknown) => {
6060
if (has(data, "{{{hydraPrefix}}}member")) {
6161
// Normalize items in collections
6262
data["{{{hydraPrefix}}}member"] = data[
6363
"{{{hydraPrefix}}}member"
64-
].map((item: any) => normalize(item));
64+
].map((item: unknown) => normalize(item));
6565

6666
return data;
6767
}

templates/next/utils/mercure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
33
import { PagedCollection } from "../types/Collection";
44
import { normalize } from "./dataAccess";
55

6-
const mercureSubscribe = (hubURL: string, data: any | PagedCollection<any>, setData: (data: any) => void) => {
6+
const mercureSubscribe = (hubURL: string, data: unknown | PagedCollection<unknown>, setData: (data: unknown) => void) => {
77
const url = new URL(hubURL, window.origin);
88
url.searchParams.append("topic", (new URL(data["@id"], window.origin)).toString());
99
const eventSource = new EventSource(url.toString());
@@ -12,7 +12,7 @@ const mercureSubscribe = (hubURL: string, data: any | PagedCollection<any>, setD
1212
return eventSource;
1313
}
1414

15-
export const useMercure = (deps: any | PagedCollection<any>, hubURL: string) => {
15+
export const useMercure = (deps: unknown | PagedCollection<unknown>, hubURL: string) => {
1616
const [data, setData] = useState(deps);
1717

1818
useEffect(() => {

0 commit comments

Comments
 (0)