Add typing
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export interface RouteMapIndex {
|
||||
routeId: string | number;
|
||||
routeStart: string;
|
||||
routeEnd: string;
|
||||
created: string;
|
||||
checked: string;
|
||||
contents: string[];
|
||||
}
|
||||
|
||||
export const load: PageLoad = async ({ fetch }) => {
|
||||
const response = await fetch('map-index.json');
|
||||
|
||||
@@ -12,6 +21,6 @@ export const load: PageLoad = async ({ fetch }) => {
|
||||
return {
|
||||
maps: maps.sort((a: any, b: any) => {
|
||||
return Number(a.routeId) - Number(b.routeId);
|
||||
})
|
||||
}) as RouteMapIndex[]
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user