mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
refactor: update type handling in SvelteKit adapter tests and MediaApi uploadFile method
This commit is contained in:
@@ -9,7 +9,8 @@ afterAll(enableConsoleLog);
|
|||||||
|
|
||||||
describe("sveltekit adapter", () => {
|
describe("sveltekit adapter", () => {
|
||||||
adapterTestSuite(bunTestRunner, {
|
adapterTestSuite(bunTestRunner, {
|
||||||
makeApp: (c, a) => sveltekit.getApp(c, a ?? ({} as any)),
|
makeApp: (c, a) => sveltekit.getApp(c as any, a ?? ({} as any)),
|
||||||
makeHandler: (c, a) => (request: Request) => sveltekit.serve(c, a ?? ({} as any))({ request }),
|
makeHandler: (c, a) => (request: Request) =>
|
||||||
|
sveltekit.serve(c as any, a ?? ({} as any))({ request }),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export class MediaApi extends ModuleApi<MediaApiOptions> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected uploadFile<T extends FileUploadedEventData>(
|
protected uploadFile<T extends FileUploadedEventData>(
|
||||||
body: File | Blob | ReadableStream | Buffer<ArrayBufferLike>,
|
body: BodyInit,
|
||||||
opts?: {
|
opts?: {
|
||||||
filename?: string;
|
filename?: string;
|
||||||
path?: TInput;
|
path?: TInput;
|
||||||
@@ -154,7 +154,7 @@ export class MediaApi extends ModuleApi<MediaApiOptions> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.uploadFile<T>(item, opts);
|
return this.uploadFile<T>(item as BodyInit, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
async uploadToEntity(
|
async uploadToEntity(
|
||||||
|
|||||||
Reference in New Issue
Block a user