Closed
Description
const PeerId = require('peer-id')
const peerId1 = PeerId.createFromB58String('QmZjTnYw2TFhn9Nn7tjmPSoTBoY7YRkwPzwSrSbabY24Kp')
const peerId2 = PeerId.createFromB58String('QmZjTnYw2TFhn9Nn7tjmPSoTBoY7YRkwPzwSrSbabY24Kp')
assert.deepEqual(peerId1, peerId2)
// 'bafzbeifjjcie6lypi6ny7amxnfftagclbuxndqonfipmb64f2km2devei4'
peerId1.toString()
assert.deepEqual(peerId1, peerId2)
// Uncaught AssertionError [ERR_ASSERTION]: Expected values to be loosely deep-equal:
This is because .toString()
has the side effect of setting a ._idCIDString
property on this
which the other peer ID doesn't have.
Metadata
Assignees
Labels
No labels
Activity