Prettier
This commit is contained in:
parent
92cbe519b7
commit
9bf3fc88a6
|
@ -22,7 +22,7 @@ export const userReviewSchema = object({
|
|||
|
||||
export const serverReviewSchema = userReviewSchema.shape({
|
||||
id: string().length(6).required(),
|
||||
timestamp: string().required()
|
||||
timestamp: string().required(),
|
||||
});
|
||||
|
||||
export type UserSideReview = InferType<typeof userReviewSchema>;
|
||||
|
@ -31,6 +31,6 @@ export type userRating = InferType<typeof rating>;
|
|||
|
||||
export interface IdRequest extends Request {
|
||||
params: {
|
||||
id: string
|
||||
}
|
||||
id: string;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import fs from "fs";
|
||||
import { ServerSideReview, UserSideReview } from "../types";
|
||||
import * as crypto from "crypto";
|
||||
import * as crypto from "crypto";
|
||||
|
||||
export function checkFile(
|
||||
file: string,
|
||||
|
@ -10,7 +10,7 @@ export function checkFile(
|
|||
const fullPath = dir + file;
|
||||
let final: ServerSideReview[];
|
||||
|
||||
if (fs.existsSync(fullPath)) {
|
||||
if (fs.existsSync(fullPath)) {
|
||||
const data = fs.readFileSync(fullPath, encoding);
|
||||
|
||||
final = !data.toString().trim() ? [] : JSON.parse(data.toString());
|
||||
|
@ -35,7 +35,7 @@ export function toServerReview(userReview: UserSideReview): ServerSideReview {
|
|||
title: userReview.title,
|
||||
content: userReview.content,
|
||||
id: generateId(),
|
||||
timestamp: getTimestamp()
|
||||
timestamp: getTimestamp(),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,6 @@ export function stripId(serverReview: ServerSideReview) {
|
|||
username: serverReview.username,
|
||||
title: serverReview.title,
|
||||
content: serverReview.content,
|
||||
timestamp: serverReview.timestamp
|
||||
timestamp: serverReview.timestamp,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue