Skip to content

Commit

Permalink
Fix circular structure stringify and bump version to 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladyslav Mashkin committed Nov 1, 2018
1 parent da41240 commit 4ac87b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports.encrypt = function (data, encryptionKey) {
}

const cipher = crypto.createCipheriv(config.ENCRYPTION_ALGORITHM, encryptionKey, iv);
const jsonToEncrypt = stringify(data);
const jsonToEncrypt = stringify(data, {cycles: true});

cipher.end(jsonToEncrypt, 'utf-8', () => {
resolve(Buffer.concat([config.VERSION_BUFFER, iv, cipher.read()]));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongoose-advanced-encryption",
"version": "0.9.0",
"version": "0.9.1",
"description": "Mongoose plugin for document fields encryption and authentication.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 4ac87b1

Please sign in to comment.