Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion netlify/edge-functions/get-geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default async (request: Request, context: Context) => {
// }
// }

// @ts-expect-error use `Response.json()` to set content-type as application/json
return Response.json({
geo: context.geo,
});
Expand Down
1 change: 0 additions & 1 deletion netlify/functions/blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default async (req: Request) => {

if (req.method === "GET") {
const todos = await store.get("todos", { type: "json" });
// @ts-expect-error `new` operator not needed for Response.json()
return Response.json(todos || [], { status: 200 });
}

Expand Down
1 change: 0 additions & 1 deletion netlify/functions/dad-joke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default async function joke() {
}
const json = await response.json();
console.log(json);
// @ts-expect-error this syntax is allowed
return Response.json(json);
} catch (error) {
console.error("Failed to fetch a dad joke:", error);
Expand Down
2 changes: 0 additions & 2 deletions netlify/functions/platform-specific.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ export default async (req: Request, context: Context) => {
const allProducts = nintendo.products.concat(sony.products);

if (!platform) {
// @ts-expect-error Response.json() does not require `new` operator
return Response.json(allProducts);
}

// ... and/or filter as needed
const filteredProducts = allProducts.filter(
(product) => product.promo === platform,
);
// @ts-expect-error Response.json() does not require `new` operator
return Response.json(filteredProducts);
};

Expand Down
2 changes: 1 addition & 1 deletion netlify/functions/stream.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { stream } from "@netlify/functions";

// @ts-expect-error async streams are allowed
// @ts-expect-error Type mismatch between Web Streams API and Node.js streams
export const handler = stream(async () => {
const encoder = new TextEncoder();
const formatter = new Intl.DateTimeFormat("en", { timeStyle: "medium" });
Expand Down
Loading