fix types issue

This commit is contained in:
Chen, Tai-Lin committed 2024-03-05 00:27:08 +08:00
1 parent ec63bba0fe
commit 807974d727
15 files changed
+49 -25

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ import { Strategy as GoogleStrategy } from 'passport-google-oidc'
import config from '../config.js'
import oauthVerify from './oauthVerify.js'
function verify(issuer: string, profile: any, cb: any) {
function verify(profile: any, cb: any) {
oauthVerify('google', profile, { 'socialLogins.google.id': profile.id }, cb)
}
+2 -2
View File
@@ -9,7 +9,7 @@ async function verifyPassword(
username: string,
password: string,
done: (
error: any,
error: Error | null,
user?: Express.User | false,
options?: IVerifyOptions
) => void
@@ -34,7 +34,7 @@ async function verifyPassword(
username: user.username,
email: user.email,
})
} catch (err) {
} catch (err: any) {
return done(err)
}
}
+2 -2
View File
@@ -82,7 +82,7 @@ export async function deleteContainer(id: string) {
}
try {
await container.stop()
} catch (error) {
} catch (error: any) {
logger.warn('Failed to stop container', id)
}
await container.remove()
@@ -127,7 +127,7 @@ export function buildQuestImage(questPath: string, questId: string) {
.forEach((line: string) => {
parseJSONOutput(line)
})
} catch (error) {
} catch (error: any) {
reject(error)
}
})
+1 -1
View File
@@ -9,7 +9,7 @@ export function asyncHandler(fn: any) {
// eslint-disable-next-line no-unused-vars
export default function errorHandler(
err: any,
err: Error,
req: Request,
res: Response,
// eslint-disable-next-line no-unused-vars
+3 -3
View File
@@ -9,9 +9,9 @@ const questDirectory = path.join(process.cwd(), '..', 'quests')
class QuestValidationError extends Error {
questId: string
error: any
error: Error | null
constructor(message: string, questId: string, error: any) {
constructor(message: string, questId: string, error: Error | null) {
super(message)
this.name = 'QuestValidationError'
this.questId = questId
@@ -68,7 +68,7 @@ export async function loadAndUpdateQuests() {
})
quest.exceptions.push(...exceptions)
await quest.save()
} catch (error) {
} catch (error: any) {
logger.error(`Error parsing quest`, { id, error })
throw new QuestValidationError(`Error parsing quest`, id, error)
}