Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jspspike committed Aug 11, 2023
1 parent 37c58b2 commit 9b183da
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/miniflare/src/workers/core/entry.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async function handleQueue(
const flattened = await request.json<number | unknown[]>();
const messages = unflatten(flattened, structuredSerializableRevivers);
const queueResponse = await service.queue(queueName, messages);
(queueResponse as QueueResponse & { time: number }).time =
(queueResponse as FetcherQueueResult & { time: number }).time =
Date.now() - startTime;
return Response.json(queueResponse);
}
Expand Down
3 changes: 0 additions & 3 deletions packages/miniflare/test/plugins/d1/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ export class TestD1Database implements D1Database {
return this[kSend]("/batch", statements);
}

// @ts-expect-error this function should return a `Promise<D1ExecResult>`,
// not a `Promise<D1Result<T>>`, `@cloudflare/workers-types` is wrong here
// TODO(now): fix in `@cloudflare/workers-types`
async exec(query: string): Promise<D1ExecResult> {
return this[kSend]("/exec", query);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/miniflare/test/plugins/d1/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default (binding: string, WORKER_PATH: string) => {
const select = await db.prepare(`SELECT * FROM ${tableColours}`);
let result: ColourRow | null = await select.first<ColourRow>();
t.deepEqual(result, { id: 1, name: "red", rgb: 0xff0000 });
let id = await select.first<number>("id");
let id: number | null = await select.first<number>("id");
t.is(id, 1);

// Check with multiple statements (should only match on first statement)
Expand Down

0 comments on commit 9b183da

Please sign in to comment.