refactor: 🚨 Use shortand property syntax for object literals

This commit is contained in:
Jesse Wierzbinski 2024-10-03 13:41:58 +02:00
parent 48ffe97849
commit 3fade63567
No known key found for this signature in database
15 changed files with 31 additions and 31 deletions

View file

@ -24,7 +24,7 @@ describe(meta.route, () => {
"X-Challenge-Solution": await getSolvedChallenge(),
},
body: JSON.stringify({
username: username,
username,
email: "bob@gamer.com",
password: "password",
agreement: "true",
@ -44,7 +44,7 @@ describe(meta.route, () => {
"X-Challenge-Solution": await getSolvedChallenge(),
},
body: JSON.stringify({
username: username,
username,
email: "bob",
password: "password",
agreement: "true",
@ -64,7 +64,7 @@ describe(meta.route, () => {
"X-Challenge-Solution": await getSolvedChallenge(),
},
body: JSON.stringify({
username: username,
username,
email: "contatc@bob.com",
agreement: "true",
locale: "en",
@ -83,7 +83,7 @@ describe(meta.route, () => {
"X-Challenge-Solution": await getSolvedChallenge(),
},
body: JSON.stringify({
username: username,
username,
email: "contact@george.com",
password: "password",
agreement: "true",
@ -119,7 +119,7 @@ describe(meta.route, () => {
"X-Challenge-Solution": await getSolvedChallenge(),
},
body: JSON.stringify({
username: username,
username,
email: "contact@george.com",
password: "password",
agreement: "true",

View file

@ -150,7 +150,7 @@ describe(meta.route, () => {
expect(response2.ok).toBe(true);
const emojis = await response2.json();
expect(emojis).not.toContainEqual(expect.objectContaining({ id: id }));
expect(emojis).not.toContainEqual(expect.objectContaining({ id }));
});
test("should delete the emoji", async () => {

View file

@ -250,7 +250,7 @@ export default apiRoute((app) =>
await db.insert(Tokens).values({
accessToken: randomString(64, "base64url"),
code: code,
code,
scope: flow.application.scopes,
tokenType: TokenType.Bearer,
userId: user.id,

View file

@ -277,7 +277,7 @@ export const followRequestToVersia = (
return {
type: "Follow",
id: id,
id,
author: follower.getUri(),
followee: followee.getUri(),
created_at: new Date().toISOString(),
@ -304,7 +304,7 @@ export const followAcceptToVersia = (
return {
type: "FollowAccept",
id: id,
id,
author: followee.getUri(),
created_at: new Date().toISOString(),
follower: follower.getUri(),

View file

@ -230,7 +230,7 @@ export class Emoji extends BaseInterface<typeof Emojis, EmojiWithInstance> {
alt: Object.entries(emoji.url)[0][1].description || undefined,
contentType: Object.keys(emoji.url)[0],
visibleInPicker: true,
instanceId: instanceId,
instanceId,
});
}
}

View file

@ -338,7 +338,7 @@ export class Instance extends BaseInterface<typeof Instances> {
name: metadata.name,
version: metadata.software.version,
logo: metadata.logo,
protocol: protocol,
protocol,
});
}

View file

@ -140,7 +140,7 @@ export class OAuthManager {
await db.insert(OpenIdAccounts).values({
serverId: sub,
issuerId: this.issuer.id,
userId: userId,
userId,
});
}
@ -273,9 +273,9 @@ export class OAuthManager {
);
return {
userInfo: userInfo,
flow: flow,
claims: claims,
userInfo,
flow,
claims,
};
}
}

View file

@ -118,7 +118,7 @@ export class Relationship extends BaseInterface<
for (const subjectId of missingSubjectsIds) {
await Relationship.insert({
ownerId: owner.id,
subjectId: subjectId,
subjectId,
languages: [],
following: false,
showingReblogs: false,

View file

@ -167,12 +167,12 @@ export class Timeline<Type extends Note | User> {
case TimelineType.Note:
return {
link,
objects: objects,
objects,
};
case TimelineType.User:
return {
link,
objects: objects,
objects,
};
}
}

View file

@ -22,8 +22,8 @@ const privateKey = await crypto.subtle.importKey(
beforeAll(async () => {
await db.insert(Applications).values({
clientId: clientId,
redirectUri: redirectUri,
clientId,
redirectUri,
scopes: scope,
name: "Test Application",
secret,

View file

@ -287,7 +287,7 @@ export default (plugin: PluginType) =>
await db.insert(Tokens).values({
accessToken: randomString(64, "base64url"),
code: code,
code,
scope: scope ?? application.scopes,
tokenType: TokenType.Bearer,
applicationId: application.id,

View file

@ -15,8 +15,8 @@ beforeAll(async () => {
await db
.insert(Applications)
.values({
clientId: clientId,
redirectUri: redirectUri,
clientId,
redirectUri,
scopes: scope,
name: "Test Application",
secret,
@ -26,8 +26,8 @@ beforeAll(async () => {
await db.insert(Tokens).values({
code: "test-code",
redirectUri: redirectUri,
clientId: clientId,
redirectUri,
clientId,
accessToken: "test-access-token",
expiresAt: new Date(Date.now() + 3600 * 1000).toISOString(),
createdAt: new Date().toISOString(),

View file

@ -12,8 +12,8 @@ const secret = "test-secret";
beforeAll(async () => {
await db.insert(Applications).values({
clientId: clientId,
redirectUri: redirectUri,
clientId,
redirectUri,
scopes: scope,
name: "Test Application",
secret,
@ -21,8 +21,8 @@ beforeAll(async () => {
await db.insert(Tokens).values({
code: "test-code",
redirectUri: redirectUri,
clientId: clientId,
redirectUri,
clientId,
accessToken: "test-access-token",
expiresAt: new Date(Date.now() + 3600 * 1000).toISOString(),
createdAt: new Date().toISOString(),

View file

@ -144,7 +144,7 @@ export const nodeDriver: RotatingFileSinkDriver<number> = {
}
return statSync(path);
},
renameSync: renameSync,
renameSync,
};
export const configureLoggers = (silent = false) =>

View file

@ -26,7 +26,7 @@ export const renderMarkdownInPath = async (
}
return {
content: content,
content,
lastModified,
};
};