Skip to content

Commit aea2879

Browse files
committed
Add type predicate
1 parent 158c3ae commit aea2879

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

demo/src/routes/+layout.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { type PageLoad } from "./$types";
1+
import type { LayoutServerLoad } from "./$types";
22
export const prerender = true;
33

4-
export const load: PageLoad = async ({ fetch }) => {
4+
export const load: LayoutServerLoad = async ({ fetch }) => {
55
const res = await fetch(
66
"https://static.datenhub.net/data/boundaries/manifest.csv",
77
);
@@ -19,7 +19,7 @@ export const load: PageLoad = async ({ fetch }) => {
1919
const m = f.match(/(?:.+_)(\d+-\d+-\d+)(?:.+)/);
2020
return m ? m[1] : null;
2121
})
22-
.filter((f: string | null) => f !== null),
22+
.filter((f: string | null): f is string => f !== null),
2323
),
2424
).sort((a, b) => b.localeCompare(a));
2525
}

0 commit comments

Comments
 (0)