From 284c42edd3adf929873f88450716e5462be56154 Mon Sep 17 00:00:00 2001 From: Seohyun Lee Date: Fri, 7 Jan 2022 01:15:03 +0900 Subject: [PATCH] fix: assert type of request --- .pnp.cjs | 20 ++++++++------------ src/app.ts | 5 ++--- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index f0ffdb3..f7c0d3a 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -11258,10 +11258,11 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { /******/ } /******/ - })() + })() /* webpack/runtime/define property getters */ /******/ - /******/ /* webpack/runtime/define property getters */ - /******/ ;(() => { + /******/ + /******/ + ;(() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for (var key in definition) { @@ -11280,10 +11281,11 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { /******/ } /******/ - })() + })() /* webpack/runtime/hasOwnProperty shorthand */ /******/ - /******/ /* webpack/runtime/hasOwnProperty shorthand */ - /******/ ;(() => { + /******/ + /******/ + ;(() => { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ @@ -11324,7 +11326,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_) // CONCATENATED MODULE: ../yarnpkg-fslib/sources/path.ts var PathType - ;(function (PathType) { PathType[(PathType['File'] = 0)] = 'File' PathType[(PathType['Portable'] = 1)] = 'Portable' @@ -11437,7 +11438,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { } // CONCATENATED MODULE: ../yarnpkg-fslib/sources/algorithms/copyPromise.ts const defaultTime = new Date(SAFE_TIME * 1000) var LinkStrategy - ;(function (LinkStrategy) { LinkStrategy['Allow'] = 'allow' LinkStrategy['ReadOnly'] = 'readOnly' @@ -14075,14 +14075,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { return true } // CONCATENATED MODULE: ../yarnpkg-fslib/sources/algorithms/watchFile/CustomStatWatcher.ts var Event - ;(function (Event) { Event['Change'] = 'change' Event['Stop'] = 'stop' })(Event || (Event = {})) var Status - ;(function (Status) { Status['Ready'] = 'ready' Status['Running'] = 'running' @@ -17459,7 +17457,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { `number`, // high ] var Errors - ;(function (Errors) { Errors[(Errors['ZIP_ER_OK'] = 0)] = 'ZIP_ER_OK' Errors[(Errors['ZIP_ER_MULTIDISK'] = 1)] = 'ZIP_ER_MULTIDISK' @@ -18075,7 +18072,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { } } // CONCATENATED MODULE: ./sources/loader/internalTools.ts var ErrorCode - ;(function (ErrorCode) { ErrorCode['API_ERROR'] = 'API_ERROR' ErrorCode['BUILTIN_NODE_RESOLUTION_FAILED'] = diff --git a/src/app.ts b/src/app.ts index 1ea318e..47d761b 100644 --- a/src/app.ts +++ b/src/app.ts @@ -26,11 +26,10 @@ app.post('/judge', (req, res) => { memoryLimit: req.body.memoryLimit, specialJudge: req.body.specialJudge, } as JudgeRequest - if(is(problem)) { + if (is(problem)) { requestJudge(problem) res.send({ success: true, uid: problem.uid }) - } - else { + } else { res.status(400) res.send({ success: false }) }