Skip to content

Commit

Permalink
Enforce eslint no-this-alias (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbarth authored Jul 18, 2023
1 parent 5ba1d04 commit fa2a403
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"deprecation/deprecation": "warn",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-this-alias": "warn"
"@typescript-eslint/no-this-alias": "error"
}
}
17 changes: 8 additions & 9 deletions src/signed-xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,21 +821,20 @@ export class SignedXml {
const signedInfoNode = signedInfoNodes[0];

if (typeof callback === "function") {
const self = this;
//Asynchronous flow
this.calculateSignatureValue(doc, function (err, signature) {
// Asynchronous flow
this.calculateSignatureValue(doc, (err, signature) => {
if (err) {
callback(err);
} else {
self.signatureValue = signature || "";
signatureDoc.insertBefore(self.createSignature(prefix), signedInfoNode.nextSibling);
self.signatureXml = signatureDoc.toString();
self.signedXml = doc.toString();
callback(null, self);
this.signatureValue = signature || "";
signatureDoc.insertBefore(this.createSignature(prefix), signedInfoNode.nextSibling);
this.signatureXml = signatureDoc.toString();
this.signedXml = doc.toString();
callback(null, this);
}
});
} else {
//Synchronous flow
// Synchronous flow
this.calculateSignatureValue(doc);
signatureDoc.insertBefore(this.createSignature(prefix), signedInfoNode.nextSibling);
this.signatureXml = signatureDoc.toString();
Expand Down

0 comments on commit fa2a403

Please sign in to comment.