mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +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", () => {
|
||||
adapterTestSuite(bunTestRunner, {
|
||||
makeApp: (c, a) => sveltekit.getApp(c, a ?? ({} as any)),
|
||||
makeHandler: (c, a) => (request: Request) => sveltekit.serve(c, a ?? ({} as any))({ request }),
|
||||
makeApp: (c, a) => sveltekit.getApp(c as any, a ?? ({} as any)),
|
||||
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>(
|
||||
body: File | Blob | ReadableStream | Buffer<ArrayBufferLike>,
|
||||
body: BodyInit,
|
||||
opts?: {
|
||||
filename?: string;
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user