Skip to content

Commit 885c220

Browse files
authored
NodeRSA.importKey() now returns this
Sometimes we find the need to daisy chain or nest functions, and I felt that returning "`this`" would allow that to happen. This would let people do stuff like `new NodeRSA().importKey(...)`, although `new NodeRSA(...)` would technically be advantageous
1 parent da04387 commit 885c220

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NodeRSA.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ module.exports = (function () {
185185
if (!formats.detectAndImport(this.keyPair, keyData, format) && format === undefined) {
186186
throw Error("Key format must be specified");
187187
}
188-
188+
189189
this.$cache = {};
190+
191+
return this;
190192
};
191193

192194
/**

0 commit comments

Comments
 (0)