Refactor metamigo-common

This commit is contained in:
Abel Luck 2023-03-13 11:12:50 +00:00
parent cae0071851
commit b3d8c3918e
32 changed files with 5 additions and 14 deletions

View file

@ -42,7 +42,6 @@ export abstract class AbstractCrudController<
abstract recordType: PgRecordInfo<TUnsavedR, TSavedR, IdKeyT>;
repo(request: Hapi.Request): CrudRepository<TUnsavedR, TSavedR, IdKeyT> {
// @ts-expect-error
const db = request[this.dbDecoration];
if (!db)
throw Boom.badImplementation(
@ -128,7 +127,6 @@ export abstract class AbstractCrudController<
): Promise<any> => {
try {
const id: IdKeyT = request.params[this.paramsIdField];
// @ts-expect-error
const row: TSavedR = await this.repo(request).findById(id);
if (!row) {

View file

@ -75,7 +75,6 @@ export class NextAuthAdapter<TRepositories extends IMetamigoRepositories>
return this.repos.users.update(user);
}
// @ts-expect-error
async linkAccount(
userId: string,
providerId: string,
@ -121,7 +120,6 @@ export class NextAuthAdapter<TRepositories extends IMetamigoRepositories>
}
const session: UnsavedSession = {
// @ts-expect-error
expires,
userId: user.id,
sessionToken: randomToken(),

View file

@ -28,14 +28,10 @@ export const deepFreeze = (o: unknown): any => {
(oIsFunction
? prop !== "caller" && prop !== "callee" && prop !== "arguments"
: true) &&
// @ts-expect-error
o[prop] !== null &&
// @ts-expect-error
(typeof o[prop] === "object" || typeof o[prop] === "function") &&
// @ts-expect-error
!Object.isFrozen(o[prop])
) {
// @ts-expect-error
deepFreeze(o[prop]);
}
});

View file

@ -1,13 +1,12 @@
{
"extends": "../tsconfig.json",
"extends": "tsconfig-link",
"compilerOptions": {
"incremental": true,
"outDir": "build/main",
"paths": {
"@hapipal/schmervice": ["vendor/hapipal__schmervice"],
"*": ["node_modules/@types/*", "*"]
}
"rootDir": "src",
"baseUrl": "./",
"types": ["jest", "node"]
},
"include": ["**/*.ts"],
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
}