Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Aug 17, 2022
1 parent 81d29ae commit fafd00f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/kit/src/runtime/server/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export async function render_endpoint(event, route) {
return method_not_allowed(mod, method);
}

const response = await handler(event);
const response = await handler(
/** @type {import('types').RequestEvent<Record<string, any>>} */ (event)
);

if (!(response instanceof Response)) {
return new Response(
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/server/page/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function render_response({
/** @type {import('types').Page} */
page: {
error,
params: event.params,
params: /** @type {Record<string, any>} */ (event.params),
routeId: event.routeId,
status,
url: state.prerendering ? new PrerenderingURL(event.url) : event.url,
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/runtime/server/page/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue, ResponseHeaders, SSRNode, CspDirectives } from 'types';
import { ResponseHeaders, SSRNode, CspDirectives } from 'types';
import { HttpError } from '../../../index/private';

export interface Fetched {
Expand All @@ -21,7 +21,7 @@ export interface FetchState {
export type Loaded = {
node: SSRNode;
data: Record<string, any> | null;
server_data: JSONValue;
server_data: any;
};

type CspMode = 'hash' | 'nonce' | 'auto';
Expand Down

0 comments on commit fafd00f

Please sign in to comment.