Compare commits

..

3 Commits

Author SHA1 Message Date
4575a1589a chore: release version v0.8.3 2017-03-16 17:06:56 +00:00
1beebb65c1 chore: update contributors 2017-03-16 17:06:55 +00:00
3dbd9a718d chore: update aegir and fix lint 2017-03-16 17:06:13 +00:00
3 changed files with 7 additions and 23 deletions

View File

@ -1,6 +1,6 @@
{
"name": "peer-id",
"version": "0.8.5",
"version": "0.8.3",
"description": "IPFS Peer Id implementation in Node.js",
"main": "src/index.js",
"bin": "src/bin.js",
@ -34,16 +34,15 @@
},
"homepage": "https://github.com/libp2p/js-peer-id",
"devDependencies": {
"aegir": "^11.0.1",
"aegir": "^11.0.0",
"chai": "^3.5.0",
"dirty-chai": "^1.2.2",
"pre-commit": "^1.2.2"
},
"dependencies": {
"async": "^2.2.0",
"libp2p-crypto": "~0.8.7",
"lodash": "^4.17.4",
"multihashes": "~0.4.5"
"libp2p-crypto": "~0.8.6",
"multihashes": "~0.4.4",
"async": "^2.1.5"
},
"repository": {
"type": "git",
@ -53,10 +52,10 @@
"David Dias <daviddias.p@gmail.com>",
"David Dias <mail@daviddias.me>",
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
"Greenkeeper <support@greenkeeper.io>",
"Prashanth Chandra <coolshanth94@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>",
"greenkeeperio-bot <support@greenkeeper.io>",
"nginnever <ginneversource@gmail.com>",
"npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>"
]

View File

@ -91,6 +91,7 @@ class PeerId {
}
exports = module.exports = PeerId
exports.Buffer = Buffer
// generation
exports.create = function (opts, callback) {
@ -218,12 +219,6 @@ exports.createFromJSON = function (obj, callback) {
}
}
exports.isPeerId = function (peerId) {
return Boolean(typeof peerId === 'object' &&
peerId._id &&
peerId._idB58String)
}
function toB64Opt (val) {
if (val) {
return val.toString('base64')

View File

@ -32,16 +32,6 @@ describe('PeerId', () => {
})
})
it('isPeerId', (done) => {
PeerId.create((err, id) => {
expect(err).to.not.exist()
expect(PeerId.isPeerId(id)).to.equal(true)
expect(PeerId.isPeerId('aaa')).to.equal(false)
expect(PeerId.isPeerId(new Buffer('batatas'))).to.equal(false)
done()
})
})
it('throws on changing the id', (done) => {
PeerId.create((err, id) => {
expect(err).to.not.exist()