From 03935492b1e36c56bf35506e66473bb8e02d1b2b Mon Sep 17 00:00:00 2001 From: legonzaur Date: Sat, 12 Aug 2023 19:59:40 +0200 Subject: [PATCH] small cleanup --- package.json | 4 +--- src/templates/server.ts | 2 +- src/types.ts | 2 -- tests/server.test.ts | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f52515f..d3fa43d 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,7 @@ "scripts": { "build": "npm run generate && npx tsc", "startServer": "node out/serverMain.js", - "startClient": "node out/clientMain.js", - "startWebsocket": "node out/websocket.js", - "documentation": "redocly build-docs .\\docs\\v2.yml --output=docs\\index.html", + "documentation": "redocly build-docs .\\docs\\v3.yml --output=docs\\index.html", "test": "jest --runInBand", "generate": "npx typia generate --input src/templates --output src/generated --project tsconfig.json" } diff --git a/src/templates/server.ts b/src/templates/server.ts index 47c22d2..1cf495e 100644 --- a/src/templates/server.ts +++ b/src/templates/server.ts @@ -9,7 +9,7 @@ import { import db, { /* createKillRecord, */ checkServerToken } from "../db"; import { validateErrors } from "../common"; import { KillData, MatchData, validateBody } from "../types"; -import typia, { validate } from "typia"; +import typia from "typia"; const router = Router(); diff --git a/src/types.ts b/src/types.ts index 887d619..d3c8f6e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -44,8 +44,6 @@ export type KillData = { cause_of_death: string; }; -type RequestBody = Request<{}, {}, T>; - export const validateBody = (checker: (input: T) => typia.IValidation): RequestHandler => (req, res, next) => { diff --git a/tests/server.test.ts b/tests/server.test.ts index 156d1ad..dde7914 100644 --- a/tests/server.test.ts +++ b/tests/server.test.ts @@ -167,7 +167,6 @@ describe('server', () => { expect(response.status).toBe(201) }) - test('register a kill with missing data', async () => { const data = testKill const response = await fetch(`http://127.0.0.1:3001/kill`, {