mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
refactor: 🚨 Use shortand property syntax for object literals
This commit is contained in:
parent
48ffe97849
commit
3fade63567
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ export class Instance extends BaseInterface<typeof Instances> {
|
|||
name: metadata.name,
|
||||
version: metadata.software.version,
|
||||
logo: metadata.logo,
|
||||
protocol: protocol,
|
||||
protocol,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ export const nodeDriver: RotatingFileSinkDriver<number> = {
|
|||
}
|
||||
return statSync(path);
|
||||
},
|
||||
renameSync: renameSync,
|
||||
renameSync,
|
||||
};
|
||||
|
||||
export const configureLoggers = (silent = false) =>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const renderMarkdownInPath = async (
|
|||
}
|
||||
|
||||
return {
|
||||
content: content,
|
||||
content,
|
||||
lastModified,
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue