Skip to content

Commit

Permalink
feat: SvelteKit HEAD export
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Jul 5, 2023
1 parent 66d1b14 commit afd38ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/svelte2tsx/src/helpers/sveltekit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function upserKitRouteFile(
addTypeToVariable(exports, surround, insert, 'ssr', `boolean`);
addTypeToVariable(exports, surround, insert, 'csr', `boolean`);

// add types to GET/PUT/POST/PATCH/DELETE/OPTIONS if not explicitly typed
// add types to GET/PUT/POST/PATCH/DELETE/OPTIONS/HEAD if not explicitly typed
const insertApiMethod = (name: string) => {
addTypeToFunction(
ts,
Expand All @@ -219,6 +219,7 @@ function upserKitRouteFile(
insertApiMethod('PATCH');
insertApiMethod('DELETE');
insertApiMethod('OPTIONS');
insertApiMethod('HEAD');

return { addedCode, originalText: source.getFullText() };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ export const kitExports: Record<
PATCH: createApiExport('PATCH'),
DELETE: createApiExport('DELETE'),
OPTIONS: createApiExport('OPTIONS'),
HEAD: createApiExport('HEAD'),
// param matching
match: {
allowedIn: [],
Expand Down

0 comments on commit afd38ea

Please sign in to comment.