Skip to content

Commit

Permalink
fix: transform types
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Oct 31, 2024
1 parent ae91f22 commit cbab38c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/svelte/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export async function timeout(ms: number) {
* async transform vite plugin. It will error out in dev mode
* if you didn't add the plugin.
*/
export function transform<T extends TaskFunction>(fn: T): T {
export function transform<TArgs, TReturn>(
fn: TaskFunction<TArgs, TReturn>,
): TaskFunction<TArgs, TReturn> {
if (DEV) {
throw new Error(
'You are using the transform function without the vite plugin. Please add the `asyncTransform` plugin to your `vite.config.ts`',
Expand Down

0 comments on commit cbab38c

Please sign in to comment.