Skip to content

Commit

Permalink
Removed redundant check before cast to string for decodeObjectId.
Browse files Browse the repository at this point in the history
  • Loading branch information
licitdev committed Jul 5, 2019
1 parent 71e1a7a commit 669f28b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,7 @@ describe('when encoding and decoding with shuffle', () => {
var hex = 'abcdef1234567890abcdef12';
var encoded = seededHashids.encodeHex('user', hex);
var decoded = seededHashids.decodeObjectId('user', encoded);
if(decoded){
decoded = decoded.toString()
}
decoded = decoded.toString()
assert.deepEqual(hex, decoded);
});

Expand All @@ -467,9 +465,7 @@ describe('when encoding and decoding with shuffle', () => {
var salt = 'somesalt';
var encoded = seededHashids.encodeHex('user', hex, salt);
var decoded = seededHashids.decodeObjectId('user', encoded, salt);
if(decoded){
decoded = decoded.toString()
}
decoded = decoded.toString()
assert.deepEqual(hex, decoded);
});

Expand Down

0 comments on commit 669f28b

Please sign in to comment.