style: format code with Prettier

This commit fixes the style issues introduced in 6e31b44 according to the output
from Prettier.

Details: None
This commit is contained in:
deepsource-autofix[bot] 2024-05-04 15:26:36 +00:00 committed by GitHub
parent 6e31b44137
commit cd6fdf3b29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 131 additions and 105 deletions

View file

@ -1,18 +1,15 @@
import { type CartItem, type Item } from './types';
import TestData from './test-data';
import { type CartItem, type Item } from "./types";
import TestData from "./test-data";
let cache: Record<string, any> = {};
// @ts-ignore
async function fakeDelay(timeout: number = 1000) {
// @ts-ignore
await new Promise((resolve: TimerHandler) => setTimeout(resolve, timeout));
}
export async function getAnnouncements(): Promise<{image: string}> {
export async function getAnnouncements(): Promise<{ image: string }> {
if (cache["announcement_banner"] !== undefined) {
return cache["announcement_banner"];
}
@ -26,7 +23,6 @@ export async function getAnnouncements(): Promise<{image: string}> {
return data;
}
export async function getPopularToday(): Promise<Item[]> {
if (cache["popular_today"] !== undefined) {
return cache["popular_today"];
@ -39,8 +35,9 @@ export async function getPopularToday(): Promise<Item[]> {
return data;
}
export async function getMenuItems(): Promise<{name: string, items: Item[]}[]> {
export async function getMenuItems(): Promise<
{ name: string; items: Item[] }[]
> {
await fakeDelay(20);
return [
{
@ -58,7 +55,6 @@ export async function getMenuItems(): Promise<{name: string, items: Item[]}[]> {
];
}
export async function getItemsByUUID(items: string[]): Promise<Item[]> {
await fakeDelay(200);
@ -79,7 +75,6 @@ export async function getItemsByUUID(items: string[]): Promise<Item[]> {
return data;
}
export async function getItemByUUID(uuid: string): Promise<Item> {
let data: Item[];
@ -98,8 +93,11 @@ export async function getItemByUUID(uuid: string): Promise<Item> {
return data[0];
}
export async function postContactEmail(name: string, email: string, message: string): Promise<string> {
export async function postContactEmail(
name: string,
email: string,
message: string
): Promise<string> {
await fakeDelay(200);
if (!name) {
@ -117,7 +115,9 @@ export async function postContactEmail(name: string, email: string, message: str
return "Check your email to confirm the message!";
}
export async function postVerifyCart(currentCartData: Record<string, CartItem>): Promise<Record<string, CartItem>> {
export async function postVerifyCart(
currentCartData: Record<string, CartItem>
): Promise<Record<string, CartItem>> {
let verifiedItems: Item[] = [];
await getItemsByUUID(Object.keys(currentCartData))