diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index fbfa832ae..b4a7691b5 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -27,9 +27,7 @@ export const DriveFileRepository = db.getRepository(DriveFile).extend({ getPublicProperties(file: DriveFile): DriveFile['properties'] { if (file.properties.orientation != null) { - // TODO - //const properties = structuredClone(file.properties); - const properties = JSON.parse(JSON.stringify(file.properties)); + const properties = structuredClone(file.properties); if (file.properties.orientation >= 5) { [properties.width, properties.height] = [properties.height, properties.width]; } diff --git a/packages/backend/src/server/web/manifest.ts b/packages/backend/src/server/web/manifest.ts index 3d01f31d5..bf87851c2 100644 --- a/packages/backend/src/server/web/manifest.ts +++ b/packages/backend/src/server/web/manifest.ts @@ -5,7 +5,7 @@ import manifest from './manifest.json' assert { type: 'json' }; export const manifestHandler = async (ctx: Koa.Context): Promise<void> => { // TODO //const res = structuredClone(manifest); - const res = JSON.parse(JSON.stringify(manifest)); + const res = structuredClone(manifest); const instance = await fetchMeta(true); diff --git a/packages/backend/src/services/relay.ts b/packages/backend/src/services/relay.ts index 5e5eb35bc..b60bbd425 100644 --- a/packages/backend/src/services/relay.ts +++ b/packages/backend/src/services/relay.ts @@ -96,9 +96,7 @@ export async function deliverToRelays(user: { id: User['id']; host: null; }, act const relays = await relaysCache.fetch(''); if (relays == null || relays.length === 0) return; - // TODO - //const copy = structuredClone(activity); - const copy = JSON.parse(JSON.stringify(activity)); + const copy = structuredClone(activity); if (!copy.to) copy.to = ['https://www.w3.org/ns/activitystreams#Public']; const signed = await attachLdSignature(copy, user);