chore(root): migrate to biome

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-16 12:20:40 +02:00
parent 1f6e198336
commit 32e91959f6
383 changed files with 1943 additions and 3085 deletions

View File

@@ -13,7 +13,7 @@ export async function updateProfile(
request: FastifyRequest<{
Body: UpdateProfilePayload;
}>,
reply: FastifyReply
reply: FastifyReply,
) {
const { profileId, properties, ...rest } = request.body;
const projectId = request.projectId;
@@ -41,7 +41,7 @@ export async function incrementProfileProperty(
request: FastifyRequest<{
Body: IncrementProfilePayload;
}>,
reply: FastifyReply
reply: FastifyReply,
) {
const { profileId, property, value } = request.body;
const projectId = request.projectId;
@@ -51,19 +51,19 @@ export async function incrementProfileProperty(
return reply.status(404).send('Not found');
}
const parsed = parseInt(
const parsed = Number.parseInt(
pathOr<string>('0', property.split('.'), profile.properties),
10
10,
);
if (isNaN(parsed)) {
if (Number.isNaN(parsed)) {
return reply.status(400).send('Not number');
}
profile.properties = assocPath(
property.split('.'),
parsed + value,
profile.properties
profile.properties,
);
await upsertProfile({
@@ -80,7 +80,7 @@ export async function decrementProfileProperty(
request: FastifyRequest<{
Body: IncrementProfilePayload;
}>,
reply: FastifyReply
reply: FastifyReply,
) {
const { profileId, property, value } = request.body;
const projectId = request.projectId;
@@ -90,19 +90,19 @@ export async function decrementProfileProperty(
return reply.status(404).send('Not found');
}
const parsed = parseInt(
const parsed = Number.parseInt(
pathOr<string>('0', property.split('.'), profile.properties),
10
10,
);
if (isNaN(parsed)) {
if (Number.isNaN(parsed)) {
return reply.status(400).send('Not number');
}
profile.properties = assocPath(
property.split('.'),
parsed - value,
profile.properties
profile.properties,
);
await upsertProfile({