From 2442a7535d8239c2b767b32d95eb5b3438d142dc Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 1 Sep 2023 09:42:38 -0700 Subject: [PATCH] Revert "perf: :zap: delete transformedOptions key -> assign undefined with key literal" This reverts commit 652ecd2d16da231d50f9739cf0b0d4237443431b. --- .../backend/src/remote/activitypub/misc/ld-signature.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/remote/activitypub/misc/ld-signature.ts b/packages/backend/src/remote/activitypub/misc/ld-signature.ts index 595510922..62707624b 100644 --- a/packages/backend/src/remote/activitypub/misc/ld-signature.ts +++ b/packages/backend/src/remote/activitypub/misc/ld-signature.ts @@ -68,13 +68,13 @@ export class LdSignature { ...options, "@context": "https://w3id.org/identity/v1", }; - transformedOptions.type = undefined; - transformedOptions.id = undefined; - transformedOptions.signatureValue = undefined; + delete transformedOptions["type"]; + delete transformedOptions["id"]; + delete transformedOptions["signatureValue"]; const canonizedOptions = await this.normalize(transformedOptions); const optionsHash = this.sha256(canonizedOptions); const transformedData = { ...data }; - transformedData.signature = undefined; + delete transformedData["signature"]; const cannonidedData = await this.normalize(transformedData); if (this.debug) console.debug(`cannonidedData: ${cannonidedData}`); const documentHash = this.sha256(cannonidedData);