From 2dd4d2494d18af843a22005a61627a3461ec29e2 Mon Sep 17 00:00:00 2001 From: Wiktor Plaga Date: Sat, 29 Jul 2023 18:50:13 +0200 Subject: [PATCH] fix: indentation, semicolons and quoting --- examples/example-nextjs13.js | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/examples/example-nextjs13.js b/examples/example-nextjs13.js index 9999d1f51..d7b1543c7 100644 --- a/examples/example-nextjs13.js +++ b/examples/example-nextjs13.js @@ -1,41 +1,41 @@ // app/api/calendar/route.ts -import icalendar from "ical-generator" -import moment from "moment" +import icalendar from 'ical-generator'; +import moment from 'moment'; export async function GET(req) { - if (req.method !== "GET") { - return new Response("Method Not Allowed", { - headers: { Allow: "GET" }, - status: 405, - }) + if (req.method !== 'GET') { + return new Response('Method Not Allowed', { + headers: { Allow: 'GET' }, + status: 405, + }); } - const filename = "calendar.ics" + const filename = 'calendar.ics'; try { - const calendar = icalendar({ - prodId: "//superman-industries.com//ical-generator//EN", - events: [ - { - start: moment(), - end: moment().add(1, "hour"), - summary: "Example Event", - description: "It works ;)", - url: "https://example.com" - } - ] - }); + const calendar = icalendar({ + prodId: '//superman-industries.com//ical-generator//EN', + events: [ + { + start: moment(), + end: moment().add(1, 'hour'), + summary: 'Example Event', + description: 'It works ;)', + url: 'https://example.com' + } + ] + }); - return new Response(calendar.toString(), { - headers: { - "Content-Type": "text/calendar; charset=utf-8", - "Content-Disposition": `attachment; filename="${filename}"`, - }, - status: 200, - }) + return new Response(calendar.toString(), { + headers: { + 'Content-Type': 'text/calendar; charset=utf-8', + 'Content-Disposition': `attachment; filename='${filename}'`, + }, + status: 200, + }); } catch (err) { - console.error(err) - return new Response(JSON.stringify(err), { status: 500 }) + console.error(err); + return new Response(JSON.stringify(err), { status: 500 }); } }