perf: ⚡ delete transformedOptions key -> assign undefined with key literal
This commit is contained in:
parent
799fcd3c73
commit
652ecd2d16
1 changed files with 4 additions and 4 deletions
|
@ -68,13 +68,13 @@ export class LdSignature {
|
|||
...options,
|
||||
"@context": "https://w3id.org/identity/v1",
|
||||
};
|
||||
delete transformedOptions["type"];
|
||||
delete transformedOptions["id"];
|
||||
delete transformedOptions["signatureValue"];
|
||||
transformedOptions.type = undefined;
|
||||
transformedOptions.id = undefined;
|
||||
transformedOptions.signatureValue = undefined;
|
||||
const canonizedOptions = await this.normalize(transformedOptions);
|
||||
const optionsHash = this.sha256(canonizedOptions);
|
||||
const transformedData = { ...data };
|
||||
delete transformedData["signature"];
|
||||
transformedData.signature = undefined;
|
||||
const cannonidedData = await this.normalize(transformedData);
|
||||
if (this.debug) console.debug(`cannonidedData: ${cannonidedData}`);
|
||||
const documentHash = this.sha256(cannonidedData);
|
||||
|
|
Loading…
Reference in a new issue