Skip to content

Commit

Permalink
refactor: deepClone to structureClone
Browse files Browse the repository at this point in the history
Signed-off-by: Umisyo <kusunokisouta@gmail.com>
  • Loading branch information
Umisyo committed Jul 4, 2023
1 parent 61e7eb8 commit cd0c4dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/core/RelayService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class RelayService {
}));
if (relays.length === 0) return;

const copy = deepClone(activity);
const copy = structuredClone(activity);
if (!copy.to) copy.to = ['https://www.w3.org/ns/activitystreams#Public'];

const signed = await this.apRendererService.attachLdSignature(copy, user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class DriveFileEntityService {
@bindThis
public getPublicProperties(file: DriveFile): DriveFile['properties'] {
if (file.properties.orientation != null) {
const properties = deepClone(file.properties);
const properties = structuredClone(file.properties);
if (file.properties.orientation >= 5) {
[properties.width, properties.height] = [properties.height, properties.width];
}
Expand Down

0 comments on commit cd0c4dc

Please sign in to comment.